/**
  * @covers ::isRoot
  */
 public function testIsRoot()
 {
     $post = new ReflectionModel('Harp\\Harp\\Test\\TestModel\\Post');
     $this->assertTrue($post->isRoot());
     $blogPost = new ReflectionModel('Harp\\Harp\\Test\\TestModel\\BlogPost');
     $this->assertFalse($blogPost->isRoot());
 }
Exemple #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;
 }