Must be GDS\Entity, or a sub-class of it
final public setEntityClass ( $str_class ) | ||
$str_class |
public function getSchema() { static $schema = false; if ($schema === false) { $schema = new Schema($this->getKind()); $schema_def = $this->getDefinition(); foreach ($schema_def as $name => $field) { if (!isset($field['type'])) { throw new Exception('Error, type not set in field deffinition'); } $func = 'add' . ucwords($field['type']); $index = isset($field['index']) ? $field['index'] : false; $schema->{$func}($name, $index); $schema->setEntityClass(get_called_class()); } } return $schema; }