public function import($scope)
 {
     if (!$this->className) {
         throw new WrongStateException("no class defined for PrimitiveUuidIdentifierList '{$this->name}'");
     }
     if (!BasePrimitive::import($scope)) {
         return null;
     }
     if (!is_array($scope[$this->name])) {
         return false;
     }
     $list = array_unique($scope[$this->name]);
     $values = array();
     foreach ($list as $id) {
         if (!Assert::checkUUID($id)) {
             return false;
         }
         $values[] = $id;
     }
     $objectList = $this->dao()->getListByIds($values);
     if (count($objectList) == count($values) && !($this->min && count($values) < $this->min) && !($this->max && count($values) > $this->max)) {
         $this->value = $objectList;
         return true;
     }
     return false;
 }
Example #2
0
 public static function check($uuid)
 {
     return Assert::checkUUID($uuid);
 }