Example #1
0
 /**
  * @param mixed $value
  * @param object $entity
  * @param string $field
  *
  * @return array|object
  */
 protected function resolveItemsControlValue($value, $entity, $field)
 {
     $dao = $this->doctrine->getDao($className = $this->getTargetClassName($entity, $field));
     $id = current($this->getMeta($className)->getIdentifierFieldNames());
     if (is_array($value)) {
         return $dao->findBy(array($id => $value));
     } elseif (is_scalar($value)) {
         return $dao->find($value);
     }
     return NULL;
 }