12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
-
- /**
- * AUTO GENERATED BY LUTICATE GENERATOR
- * ANY CHANGES WILL BE OVERWRITTEN
- * DO NOT DIRECTLY USE THIS FILE
- * USE LuticateUsers.php
- * TO MAKE YOUR CHANGES AND DATABASE ACCESS
- */
-
- namespace Luticate\Auth\DataAccess\Models;
-
- use Luticate\Utils\LuModel;
- use Luticate\Auth\DBO\LuticateUsersDbo;
-
- class LuticateUsersModel extends LuModel
- {
- function __construct()
- {
- parent::__construct();
- $this->timestamps = false;
- }
-
- public function toDbo()
- {
- $dbo = new LuticateUsersDbo();
-
- $dbo->setId($this->id);
- $dbo->setUsername($this->username);
- $dbo->setEmail($this->email);
- $dbo->setPassword($this->password);
- $dbo->setSalt($this->salt);
- $dbo->setProfileId($this->profile_id);
- $dbo->setFirstname($this->firstname);
- $dbo->setLastname($this->lastname);
-
- return $dbo;
- }
-
- /**
- * @param $dbo LuticateUsersDbo
- * @param $model LuModel|null
- * @return LuticateUsers
- */
- public function fromDbo($dbo, $model = null)
- {
- if (is_null($model))
- $model = new LuticateUsers();
-
- $model->id = $dbo->getId();
- $model->username = $dbo->getUsername();
- $model->email = $dbo->getEmail();
- $model->password = $dbo->getPassword();
- $model->salt = $dbo->getSalt();
- $model->profile_id = $dbo->getProfileId();
- $model->firstname = $dbo->getFirstname();
- $model->lastname = $dbo->getLastname();
-
- return $model;
- }
- }
|