예제 #1
0
 /**
  * EntityUsuario constructor.
  * @param string $primaryKey
  */
 public function __construct($primaryKey = "", $data = array())
 {
     parent::__construct($data);
     if (!empty($primaryKey)) {
         $this->find($primaryKey);
     }
 }
예제 #2
0
 private function processHasOneWith()
 {
     if (count($this->_with) == 0) {
         return;
     }
     foreach ($this->_with as $name => $opts) {
         $relationType = strtolower($opts[0]);
         $modelName = $opts[1];
         $key = null;
         if (isset($opts[2])) {
             $key = $opts[2];
         }
         if ($relationType == 'hasone') {
             $this->db->setQueryOption("MYSQLI_NESTJOIN");
             $this->join($modelName, $key);
         }
     }
 }