Example #1
0
 private function create(Person $aPerson)
 {
     $db = $this->db();
     $db->createCommand()->insert(self::$tableName, ['first_name' => $aPerson->firstName(), 'last_name' => $aPerson->lastName(), 'studio_id' => $aPerson->studioId(), 'sex' => $aPerson->sex() ? $aPerson->sex()->type() : null, 'date_birth' => $aPerson->dateBirth() ? $aPerson->dateBirth()->format('Y-m-d H:i:s') : null, 'mob_phone' => $aPerson->mobPhone(), 'phone' => $aPerson->phone(), 'address' => $aPerson->address(), 'email' => $aPerson->email(), 'about' => $aPerson->about()])->execute();
     $aPerson->setId($db->getLastInsertID());
 }