__construct() private method

构造函数为private,防止创建对象
private __construct ( )
	public function __construct($port){   //重写了继承过父类的参数

		//有了保险,选继承父类的构造函数
		parent::__construct();
		$this->prot = $port;
		$this->conn = mysql_connect("localhost:$prot", 'root', '123456');
		echo $this->port,'----<br/>';



	}
Example #2
0
 public function __construct($id = '')
 {
     parent::__construct();
     $this->class = strtolower(get_class($this));
     $obj = new ReflectionClass($this->class);
     $this->data = $obj->getStaticPropertyValue('definitation');
     if ($id != '') {
         $this->where = array($this->data['primary'] => $id);
         $this->order_by = array($this->data['primary'] => 'desc');
         $this->return = 1;
         $this->getData = $this->select();
     }
 }
Example #3
0
 public function __construct()
 {
     parent::__construct();
 }
Example #4
0
 public function __construct($host, $user, $password, $dbName)
 {
     parent::__construct($host, $user, $password, $dbName);
 }
Example #5
0
 /**
  * Constructor
  *
  * @param array $config Array of configuration information for the Datasource.
  * @param bool $autoConnect Whether or not the datasource should automatically connect.
  * @throws MissingConnectionException when a connection cannot be made.
  */
 public function __construct($config = null, $autoConnect = true)
 {
     parent::__construct($config, $autoConnect);
     $this->columns['uuid'] = array('name' => 'char', 'limit' => '36');
 }