userModel = new \App\Models\Model\Entity\DataMapModel();
}
public function index()
{
echo '';
// user 생성
$idx = $this->create();
// user 조회
$user = $this->find($idx);
// user 삭제
$this->userModel->delete($idx);
echo '
';
}
protected function create()
{
$user = new \App\Entities\DataMapEntity();
$user->full_name = 'foo' . time();
$user->email = 'foo@example.com';
$user->password = '12345';
$this->userModel->save($user);
echo "Create User
";
return $this->userModel->getInsertID();
}
protected function find($idx)
{
$user = $this->userModel->find($idx);
// Display
print_r($user->toArray());
return $user;
}
}