password)) ? $user : new NullDataStore(); } public static function getProps() { return [ 'name', 'email', 'password', 'profilePic', 'level', 'sharedDepartmentList', 'sharedTicketList', 'lastLogin', 'ownStatList', 'sendEmailOnNewTicket' ]; } public function getDefaultProps() { return [ 'level' => 1, 'ownStatList' => new DataStoreList(), 'sendEmailOnNewTicket' => 0 ]; } public static function getUser($value, $property = 'id') { return parent::getDataStore($value, $property); } public function toArray() { return [ 'id' => $this->id, 'name' => $this->name, 'email' => $this->email, 'profilePic' => $this->profilePic, 'level' => $this->level, 'departments' => $this->sharedDepartmentList->toArray(), 'tickets' => $this->sharedTicketList->toArray(), 'lastLogin' => $this->lastLogin , 'sendEmailOnNewTicket' => $this->sendEmailOnNewTicket ]; } }