Пример #1
0
 public function verify()
 {
     if (true !== ($r = parent::verify())) {
         return $r;
     }
     $model = self::$models[get_class($this)];
     if (!isset($this->parent)) {
         $this->parent = null;
     }
     if (!isset($this->iri)) {
         $this->iri = null;
     }
     $cs = $model->locateObject('[scheme:' . $this->kind . ']', null, 'scheme');
     $this->referenceObject('scheme', $cs);
     if (!isset($this->fragment)) {
         $this->fragment = $cs->singular;
     }
     $root = '/' . $cs->relativeURI;
     $parent = $this->parent;
     if (substr($parent, 1, 0) == '/') {
         $parent = substr($parent, 1);
     }
     if (!strncmp($parent, $root, strlen($root))) {
         $parent = substr($parent, strlen($root));
     }
     if (strlen($parent)) {
         if (null === ($uuid = UUID::isUUID($parent))) {
             $uuid = $model->createClassificationPath($cs, $parent);
         }
         if (null === $uuid && strlen($parent)) {
             return 'Referenced parent path "' . $this->parent . '" is invalid';
         }
     } else {
         $this->parent = $parent = null;
         $uuid = $cs->uuid;
     }
     $this->referenceObject('parent', $uuid);
     if (!isset($this->slug) || !strlen($this->slug)) {
         $this->slug = $this->uuid;
     }
     $p = $this->parent;
     $uri = array($this->slug);
     $ancestors = array();
     while ($p !== null) {
         $ancestors[] = $p;
         $data = $model->dataForUUID($p);
         array_unshift($uri, $data['slug']);
         $p = isset($data['parent']) ? $data['parent'] : null;
     }
     $this->relativeURI = implode('/', $uri);
     $this->iri[] = $root . implode('/', $uri);
     $this->ancestors = $ancestors;
     return true;
 }
Пример #2
0
 public function verify()
 {
     $model = self::$models[get_class($this)];
     if (isset($this->show)) {
         if (null !== ($uuid = UUID::isUUID($this->show)) || null !== ($uuid = $model->uuidForCurie($this->show))) {
             $this->referenceObject('show', $uuid);
         } else {
             return "Referenced show '" . $this->show . "' does not exist yet.";
         }
     }
     return parent::verify();
 }
Пример #3
0
 public function verify()
 {
     $model = self::$models[get_class($this)];
     if (isset($this->episode)) {
         if (null !== ($uuid = UUID::isUUID($this->episode)) || null !== ($uuid = $model->uuidForCurie($this->episode))) {
             $this->referenceObject('episode', $uuid);
         } else {
             return "Referenced episode '" . $this->episode . "' does not exist yet.";
         }
     }
     if (true !== ($r = $this->verifyCredits())) {
         return $r;
     }
     return parent::verify();
 }
Пример #4
0
 public function verify()
 {
     $model = self::$models[get_class($this)];
     return parent::verify();
 }