Gc\Document\Model::init PHP Method

init() public method

Initiliaze document
public init ( integer $documentId = null ) : void
$documentId integer Document id
return void
    public function init($documentId = null)
    {
        if (!empty($documentId)) {
            $this->setId($documentId);
        }
        $this->getChildren();
    }

Usage Example

Example #1
0
 /**
  * Test
  *
  * @return void
  */
 public function testInit()
 {
     $id = $this->object->getId();
     $this->object->init($id);
     $this->assertEquals($id, $this->object->getId());
 }