Sulu\Bundle\ContactBundle\Entity\Address::setTitle PHP Метод

setTitle() публичный Метод

Set title.
public setTitle ( string $title ) : Address
$title string
Результат Address
    public function setTitle($title)
    {
        $this->title = $title;
        return $this;
    }

Usage Example

Пример #1
0
 /**
  * Updates the given address.
  *
  * @param Address $address The phone object to update
  * @param mixed   $entry   The entry with the new data
  * @param bool    $isMain  returns if address should be set to main
  *
  * @throws \Sulu\Component\Rest\Exception\EntityNotFoundException
  *
  * @return bool True if successful, otherwise false
  */
 protected function updateAddress(Address $address, $entry, &$isMain = null)
 {
     $success = true;
     $addressType = $this->em->getRepository(self::$addressTypeEntityName)->find($entry['addressType']['id']);
     $country = $this->em->getRepository(self::$countryEntityName)->find($entry['country']['id']);
     if (!$addressType) {
         throw new EntityNotFoundException(self::$addressTypeEntityName, $entry['addressType']['id']);
     } else {
         if (!$country) {
             throw new EntityNotFoundException(self::$countryEntityName, $entry['country']['id']);
         } else {
             $address->setStreet($entry['street']);
             $address->setNumber($entry['number']);
             $address->setZip($entry['zip']);
             $address->setCity($entry['city']);
             $address->setState($entry['state']);
             $address->setCountry($country);
             $address->setAddressType($addressType);
             if (isset($entry['note'])) {
                 $address->setNote($entry['note']);
             }
             if (isset($entry['title'])) {
                 $address->setTitle($entry['title']);
             }
             if (isset($entry['primaryAddress'])) {
                 $isMain = $this->getBooleanValue($entry['primaryAddress']);
             } else {
                 $isMain = false;
             }
             if (isset($entry['billingAddress'])) {
                 $address->setBillingAddress($this->getBooleanValue($entry['billingAddress']));
             }
             if (isset($entry['deliveryAddress'])) {
                 $address->setDeliveryAddress($this->getBooleanValue($entry['deliveryAddress']));
             }
             if (isset($entry['postboxCity'])) {
                 $address->setPostboxCity($entry['postboxCity']);
             }
             if (isset($entry['postboxNumber'])) {
                 $address->setPostboxNumber($entry['postboxNumber']);
             }
             if (isset($entry['postboxPostcode'])) {
                 $address->setPostboxPostcode($entry['postboxPostcode']);
             }
             if (isset($entry['addition'])) {
                 $address->setAddition($entry['addition']);
             }
         }
     }
     return $success;
 }