コード例 #1
0
ファイル: OSchema.php プロジェクト: Edencia/orientdb-php-odm
 /**
  * @param string $name
  *
  * @return OClass
  * @throws OSchemaException
  */
 public function getClass($name)
 {
     if (!isset($this->_classes[$name])) {
         throw OSchemaException::classDoesNotExist($name);
     }
     return $this->_classes[$name];
 }
コード例 #2
0
ファイル: OClass.php プロジェクト: Edencia/orientdb-php-odm
 /**
  * @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);
 }