Gc\DocumentType\Model::getDependencies PHP Method

getDependencies() public method

Get dependencies
public getDependencies ( ) : array
return array
    public function getDependencies()
    {
        $dependencies = $this->getData('dependencies');
        if (empty($dependencies)) {
            $select = new Sql\Select();
            $select->from(array('dtd' => 'document_type_dependency'))->columns(array('children_id'))->where->equalTo('parent_id', $this->getId());
            $rows = $this->fetchAll($select);
            $result = array();
            foreach ($rows as $row) {
                $result[] = $row['children_id'];
            }
            $this->setData('dependencies', $result);
        }
        return $this->getData('dependencies');
    }

Usage Example

Beispiel #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testGetDependencies()
 {
     $this->assertInternalType('array', $this->object->getDependencies());
 }