init() public method

Initiliaze collection
public init ( integer $documentTypeId = null ) : void
$documentTypeId integer Optional document type id
return void
コード例 #1
0
ファイル: CollectionTest.php プロジェクト: gotcms/gotcms
 /**
  * Test
  *
  * @return void
  */
 public function testDeleteFailed()
 {
     $this->object->init(0);
     $this->assertFalse($this->object->delete());
 }
コード例 #2
0
ファイル: Model.php プロジェクト: gotcms/gotcms
 /**
  * Get available views
  *
  * @return \Gc\View\Collection
  */
 public function getAvailableViews()
 {
     if ($this->getData('available_views') === null) {
         $viewsCollection = new View\Collection();
         $viewsCollection->init($this->getId());
         $this->setData('available_views', $viewsCollection);
     }
     return $this->getData('available_views');
 }