示例#1
0
 /**
  * Transforms an object to a string (id).
  *
  * @param  City|null $city
  * @return string
  */
 public function transform($city)
 {
     if (null === $city) {
         return '';
     }
     return $city->getId();
 }
示例#2
0
 /**
  * Transforms an object to a string (id).
  *
  * @param  City|null $city
  * @return string
  */
 public function transform($city)
 {
     if (null === $city) {
         return '';
     }
     $title = $city->getTitle();
     if ($country = $city->getCountry()) {
         $title .= ', ' . $country->getTitle();
     }
     return $title;
 }