/** * @param SchemaBuilder $builder Parent ORM schema (all other documents). * @param string $class Class name. * @throws \ReflectionException * @throws DefinitionException * @throws RecordSchemaException */ public function __construct(SchemaBuilder $builder, $class) { parent::__construct($class); $this->builder = $builder; //Associated table $this->tableSchema = $this->builder->declareTable($this->getDatabase(), $this->getTable()); }
/** * @param SchemaBuilder $builder Parent ORM schema (all other documents). * @param string $class Class name. * @throws \ReflectionException * @throws DefinitionException * @throws RecordSchemaException */ public function __construct(SchemaBuilder $builder, $class) { parent::__construct($class); $this->builder = $builder; //Associated table $this->tableSchema = $this->builder->declareTable($this->getDatabase(), $this->getTable()); /** * Use record schema (property) to declare table indexes, columns and default values. * No relations has to be declared at this point. */ $this->castSchema(); }
/** * @param SchemaBuilder $builder Parent ODM schema (all other documents). * @param string $class Class name. * @throws \ReflectionException */ public function __construct(SchemaBuilder $builder, $class) { $this->builder = $builder; parent::__construct($class); }