image = new NullMedia(); $this->account = $account ?? new NullAccount(); } /** * Get account id. * * @return int Account id * * @since 1.0.0 */ public function getId() : int { return $this->id; } /** * Get gender. * * @return int Returns the gender (GenderType) * * @since 1.0.0 */ public function getGender() : int { return $this->gender; } /** * Get gender. * * @param int $gender Gender * * @return void * * @throws InvalidEnumValue This exception is thrown if a invalid gender is used * * @since 1.0.0 */ public function setGender(int $gender) : void { if (!GenderType::isValidValue($gender)) { throw new InvalidEnumValue($gender); } $this->gender = $gender; } /** * Get sex. * * @return int Returns the sex (SexType) * * @since 1.0.0 */ public function getSex() : int { return $this->sex; } /** * Get sex. * * @param int $sex Sex * * @return void * * @throws InvalidEnumValue This exception is thrown if a invalid sex is used * * @since 1.0.0 */ public function setSex(int $sex) : void { if (!SexType::isValidValue($sex)) { throw new InvalidEnumValue($sex); } $this->sex = $sex; } /** * Get account locations. * * @return Location[] * * @since 1.0.0 */ public function getLocation() : array { return $this->location; } /** * Add location. * * @param Location $location Location * * @return void * * @since 1.0.0 */ public function addLocation(Location $location) : void { $this->location[] = $location; } /** * Get account contact element. * * @return ContactElement[] * * @since 1.0.0 */ public function getContactElements() : array { return $this->contactElements; } /** * Add contact element. * * @param ContactElement $contactElement Contact Element * * @return void * * @since 1.0.0 */ public function addContactElement(ContactElement $contactElement) : void { $this->contactElements[] = $contactElement; } /** * {@inheritdoc} */ public function toArray() : array { return [ 'id' => $this->id, 'sex' => $this->sex, 'gender' => $this->gender, 'account' => $this->account, 'image' => $this->image, 'birthday' => $this->birthday, 'locations' => $this->location, 'contactelements' => $this->contactElements, ]; } /** * {@inheritdoc} */ public function jsonSerialize() { return $this->toArray(); } }