Beispiel #1
0
 /**
  * 获取当前ORM的主键键名
  *
  * [!!] key 为字段所对应的 key, value为字段名
  *
  * @return array
  */
 public function get_pk_name()
 {
     if ($this->_temp_instance_pk) {
         return $this->_temp_instance_pk;
     } elseif ($this->_is_temp_instance) {
         # 默认主键
         return array('id' => 'id');
     }
     return OOP_ORM_DI::get_pk_name_by_class_name($this->_class_name);
 }
Beispiel #2
0
 /**
  * 获取当前ORM的主键
  *
  * [!!] 其中key是对象的key,value是字段名
  *
  * @return array
  */
 public function get_pk_name()
 {
     return OOP_ORM_DI::get_pk_name_by_class_name(strtolower($this->get_orm_name('data')));
 }