Exemplo n.º 1
0
 /**
  * @covers ::setTable
  * @covers ::getTable
  */
 public function testTable()
 {
     $config = new Config(__NAMESPACE__ . '\\TestModel\\User');
     $this->assertEquals('User', $config->getTable());
     $config->setTable('users');
     $this->assertEquals('users', $config->getTable());
 }
Exemplo n.º 2
0
 /**
  * Enables Repo "inheritance" allowing multiple repos to share one storage table
  * You will need to call setRootRepo on all the child repos.
  *
  * @param  boolean      $inherited
  * @return Config $this
  */
 public function setInherited($inherited)
 {
     $this->inherited = (bool) $inherited;
     if ($inherited) {
         if (!$this->reflectionModel->isRoot()) {
             $rootRepo = Container::get($this->reflectionModel->getRoot()->getName());
             $this->rootConfig = $rootRepo->getConfig();
         }
         $this->table = $this->rootConfig->getTable();
     }
     return $this;
 }