Ejemplo n.º 1
0
 /**
  * @param string        $type
  * @param callable|null $callback
  *
  * @return Inheritance
  */
 public function inheritance($type, callable $callback = null)
 {
     $inheritance = InheritanceFactory::create($type, $this->builder);
     if (is_callable($callback)) {
         $callback($inheritance);
     }
     return $inheritance;
 }
Ejemplo n.º 2
0
 public function test_can_only_create_joined_or_single_table_inheritance()
 {
     $this->setExpectedException(InvalidArgumentException::class, 'Inheritance type [NON_EXISTING] does not exist. SINGLE_TABLE and JOINED are support');
     InheritanceFactory::create('NON_EXISTING', $this->builder);
 }