php设计模式之——建造者模式

   & lt; php ?/* *   * *建造者模式:消除其他对象复杂的创建过程   * * * * */class 用户信息{   protected  _age美元;   protected  _name美元;   protected  _prov美元;   public  function  __construct () {      }      public  function  setAge(年龄美元){   美元=$ this→_age 年龄;   }      public  function  setName(美元名称){=$ this→_name 美元名称;   }      public  function  setProv(新城东区美元){=$ this→_prov 美元箴言;   }      public  function  -盖特曼(){   echo 这→美元_age。$ this→_name。$ this→箴言;   }   }      class 建筑{   protected  man 美元;=,”;   public  function  __construct () {=$ this→man  new 用户信息();   }      public  function  buildman(数组){   $ this→人→setAge ($ array[‘年龄’);   $ this→人→setAge ($ array['名称');   $ this→人→setAge ($ array[“箴言”);      }      public  function  -盖特曼(){   $ this→→人-盖特曼();   }   }


php设计模式之——建造者模式