Beispiel #1
0
 /**
  * Set value
  *
  * @param mixed $value Value to set
  *
  * @return void
  */
 public function setValue($value)
 {
     if (is_object($value) && $value instanceof \XLite\Model\AEntity) {
         $value = $value->getUniqueIdentifier();
     }
     parent::setValue($value);
 }
Beispiel #2
0
 /**
  * Set value
  *
  * @param mixed $value Value to set
  *
  * @return void
  */
 public function setValue($value)
 {
     if (is_object($value) && $value instanceof \Doctrine\Common\Collections\Collection) {
         $value = $value->toArray();
     } elseif (!is_array($value)) {
         $value = array($value);
     }
     foreach ($value as $k => $v) {
         if (is_object($v) && $v instanceof \XLite\Model\AEntity) {
             $value[$k] = $v->getUniqueIdentifier();
         }
     }
     parent::setValue($value);
 }