/** * @param string $name * * @return OClass * @throws OSchemaException */ public function getClass($name) { if (!isset($this->_classes[$name])) { throw OSchemaException::classDoesNotExist($name); } return $this->_classes[$name]; }
/** * @param string $name * @param string[] $properties * @param string $type * * @return OIndex * @throws OSchemaException */ private function _createIndex($name, array $properties, $type) { $meta = ['name' => $name, 'type' => $type, 'fields' => $properties]; foreach ($properties as $p) { if (!$this->hasProperty($p)) { throw OSchemaException::propertyDoesNotExist($p, $this->getName()); } } return new OIndex($this, $meta); }