/** * Return the properties in an array. * * @return array */ public function toArray() { $array = parent::toArray(); $array['user'] = $this->user; ksort($array); return $array; }
/** * @return array */ public function toArray() { $array = parent::toArray(); $array['passwordProtected'] = !!$this->password; $array['thumbnail'] = $this->getThumbnailImageFile(); $array['url'] = $this->getUrl(); // Album belongs to the current user? if (Auth::check() && Auth::user()->userId == $this->userId) { // Any extra info for the album owner $array['anonymous'] = $this->anonymous; } else { if ($this->anonymous) { $array['userId'] = null; } } ksort($array); return $array; }
/** * @return array */ public function toArray() { $array = parent::toArray(); $array['url'] = $this->getUrl(); $array['size'] = $this->optimizedSize ? $this->optimizedSize : $this->size; ksort($array); return $array; }
/** * Return the properties in an array. * * @param bool $authenticated If this is the current logged in user we return more info. * * @return array */ public function toArray($authenticated = false) { $array = parent::toArray(); $array['url'] = $this->getUrl(); // Is the current user? if (Auth::check() && Auth::user()->userId == $this->userId) { // Any extra info for the account owner $array['defaultPassword'] = !!$this->defaultPassword; } else { unset($array['email']); unset($array['defaultAnonymous']); unset($array['moderator']); unset($array['updatedAt']); } ksort($array); return $array; }