getParent() public method

(non-PHPdoc)
See also: include Gc\Component\IterableInterface#getParent()
public getParent ( ) : Model
return Model
Example #1
0
 /**
  * Get locale according to the locale specified in the document or its parent.
  *
  * @param Document\Model $document Document
  *
  * @return void
  */
 protected function getLocale($document)
 {
     $locale = null;
     if (!$document->hasLocale()) {
         $parent = $document->getParent();
         if ($parent) {
             $locale = $this->getLocale($parent);
         }
     } else {
         $locale = $document->getLocale();
     }
     return $locale;
 }
Example #2
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetParent()
 {
     $this->assertInstanceOf('Gc\\Document\\Model', $this->object->getParent());
 }