public function verify() { $model = self::$models[get_class($this)]; if (true !== ($r = parent::verify())) { return $r; } if (isset($this->notionalDate)) { if (isset($this->date)) { $this->notionalDate = $this->date; } else { return "Events must at least have a notional date"; } } $this->transformProperty('factor', 'factors', true); $this->transformProperty('agent', 'agents', true); $this->transformProperty('place', 'places', true); if (isset($this->factors)) { foreach ($this->factors as $k => $factor) { if (null === ($obj = $model->locateObject($factor, null, 'thing', $this->universe))) { return 'Factor "' . $factor . '" does not exist yet'; } $this->factors[$k] = $obj->uuid; } } if (isset($this->agents)) { foreach ($this->agents as $k => $character) { if (null === ($obj = $model->locateObject($character, null, 'character', $this->universe))) { return 'Agent "' . $character . '" does not exist yet'; } $this->agents[$k] = $obj->uuid; } } if (isset($this->places)) { foreach ($this->places as $k => $place) { if (null === ($obj = $model->locateObject($place, null, 'place', $this->universe))) { return 'Place "' . $place . '" does not exist yet'; } $this->places[$k] = $obj->uuid; } } return true; }
public function verify() { $this->transformProperty('event', 'events', true); return parent::verify(); }