Ejemplo n.º 1
0
 public function isOwnTheObject(EntityUser $user)
 {
     if (!empty($user->getId()) && $user->getId() == $this->createdBy) {
         return true;
     }
     return false;
 }
Ejemplo n.º 2
0
 function add_user($name, $email, $address)
 {
     $us = new EntityUser();
     $us->setName($name);
     $us->setEmail($email);
     $us->setAddress($address);
     try {
         //save to database
         $this->em->persist($us);
         $this->em->flush();
     } catch (Exception $err) {
         die($err->getMessage());
     }
     return true;
 }
Ejemplo n.º 3
0
 public function _construct()
 {
     self::$_dataTypes = array('email' => array('type' => 'string', 'size' => 100, 'nullable' => false), 'userpassword' => array('type' => 'string', 'size' => 100, 'nullable' => false), 'username' => array('type' => 'string', 'size' => 100), 'surname' => array('type' => 'string', 'size' => 100), 'phone' => array('type' => 'string', 'size' => 200), 'birthday' => array('type' => 'date'), 'gendor' => array('type' => 'string', 'size' => 1), 'rate' => array('type' => 'int'), 'photo' => array('type' => 'string', 'size' => 200), 'crdate' => array('type' => 'datetime', 'nullable' => false), 'access' => array('type' => 'string', 'size' => 2, 'nullable' => false), 'userstatus' => array('type' => 'int', 'nullable' => false));
 }