Beispiel #1
0
 /**
  * @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());
 }
Beispiel #2
0
 /**
  * @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();
 }