_setupPrimaryKey() protected method

If $_primary is not defined, discover primary keys from the information returned by describeTable().
protected _setupPrimaryKey ( ) : void
return void
示例#1
0
 protected function _setupPrimaryKey()
 {
     if (empty($this->_primary)) {
         $this->_primary = 'id';
     }
     parent::_setupPrimaryKey();
 }
示例#2
0
 protected function _setupPrimaryKey()
 {
     $this->_primary = 'blog_id';
     parent::_setupPrimaryKey();
 }