Zephir\ClassDefinition::addInitMethod PHP Method

addInitMethod() public method

Creates the initialization method
public addInitMethod ( zephir\StatementsBlock $statementsBlock )
$statementsBlock zephir\StatementsBlock
    public function addInitMethod(StatementsBlock $statementsBlock)
    {
        if (!$statementsBlock->isEmpty()) {
            $initClassName = $this->getCNamespace() . '_' . $this->getName();
            $classMethod = new ClassMethod($this, array('internal'), 'zephir_init_properties_' . $initClassName, null, $statementsBlock);
            $classMethod->setIsInitializer(true);
            $this->addMethod($classMethod);
        }
    }