示例#1
0
    public function afterConstruct($event) { 

        Yii::import('system.vendors.lifei.DbIDGenerator');

        if($this->owner->isNewRecord && $this->owner->getPrimaryKey() == NULL) {
            $this->owner->setPrimaryKey(DbIDGenerator::nextId());
        }
    } 
示例#2
0
文件: CEntity.php 项目: njxjxj/yorm
 protected function afterConstruct()
 {
     parent::afterConstruct();
     if ($this->isNewRecord && $this->getPrimaryKey() == NULL) {
         $this->setPrimaryKey(DbIDGenerator::nextId());
     }
 }