Ejemplo n.º 1
0
 function __construct($classPrepend = null, $nodeTypeName = null)
 {
     parent::__construct('buildings', 'building', $classPrepend !== null ? $classPrepend : '\\PE\\Samples\\Farm', $nodeTypeName);
     $type = $this->addVariable(new EncoderNodeVariable('type'));
     $typePostNodeGetter = $type->postNodeGetter(new PostNodeGetter('getBuildingType', array(NodeAccessor::VARIABLE_OBJECT)));
     $typePostNodeGetter->alwaysExecute(true);
 }
 function __construct($addVariables = true)
 {
     parent::__construct('requiredConstructorsVariables', 'requiredConstructorVariables', '\\PE\\Samples\\Specials');
     if ($addVariables === true) {
         $this->addVariable(new EncoderNodeVariable('name'));
         $this->addVariable(new EncoderNodeVariable('variableCategory'));
     }
 }
 function __construct()
 {
     parent::__construct('accessorMethodActionTypeNodes', 'accessorMethodActionTypeNode', '\\PE\\Samples\\Specials');
     $this->addVariable(new EncoderNodeVariable('special'));
     $special = $this->addVariable(new EncoderNodeVariable('node', false));
     $special->postNodeSetter(new PostNodeSetter('addNodeToSpecial', array(NodeAccessor::VARIABLE_NAME)));
     $special->postNodeGetter(new PostNodeGetter('getNodeFromSpecial', array(NodeAccessor::VARIABLE_NAME)));
 }
 function __construct($addAfterAttributes = true)
 {
     parent::__construct('addAfterDecodeParents', 'addAfterDecodeParent', '\\PE\\Samples\\Specials');
     $this->addVariable(new EncoderNodeVariable('name'));
     $addAfterDecodeChildSetter = new NodeChildSetter('addChild');
     $addAfterDecodeChildSetter->setAfterChildren(false);
     $addAfterDecodeChildSetter->setAfterAttributes($addAfterAttributes);
     $this->addChildNode(new EncoderNodeChild('addAfterDecodeChild', $addAfterDecodeChildSetter, new NodeChildGetter('getChildren')));
     $this->addChildNode(new EncoderNodeChild('addAfterDecodeChildrenRequire', new NodeChildSetter('addChildRequires'), new NodeChildGetter('getChildrenRequires')));
 }
Ejemplo n.º 5
0
 function __construct()
 {
     parent::__construct('variableTypes', 'variableType', '\\PE\\Samples\\Specials');
     $required = $this->addVariable(new EncoderNodeVariable('required'));
     $required->setType(EncoderNodeVariable::TYPE_STRING);
     $required->preNodeSetter(new PreNodeSetter('preNodeRequiredSetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_PARENT)));
     $required->postNodeSetter(new PostNodeSetter('postNodeRequiredSetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $required->preNodeGetter(new PreNodeGetter('preNodeRequiredGetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $required->postNodeGetter(new PostNodeGetter('postNodeRequiredGetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $optional = $this->addVariable(new EncoderNodeVariable('optional'));
     $optional->preNodeSetter(new PreNodeSetter('preNodeOptionalSetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_PARENT)));
     $optional->postNodeSetter(new PostNodeSetter('postNodeOptionalSetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $optional->preNodeGetter(new PreNodeGetter('preNodeOptionalGetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $optional->postNodeGetter(new PostNodeGetter('postNodeOptionalGetter', array(NodeAccessor::VARIABLE_NODE, NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
 }
 function __construct()
 {
     parent::__construct('encoderNodeVariableApplyToSettersNode', 'encoderNodeVariableApplyToSetterNode', '\\PE\\Samples\\Specials');
     $nodeSimple = $this->addVariable(new EncoderNodeVariable('nodeSimple'));
     $nodeSimple->postNodeSetter(new PostNodeSetter('nodeSimple', array(NodeAccessor::VARIABLE_NAME)));
     $nodeFull = $this->addVariable(new EncoderNodeVariable('nodeFull'));
     $nodeFull->postNodeSetter(new PostNodeSetter('nodeFull', array(NodeAccessor::VARIABLE_NAME, NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_OBJECT, NodeAccessor::VARIABLE_PARENT)));
     $nodeWithoutVariables = $this->addVariable(new EncoderNodeVariable('nodeWithoutVariables'));
     $nodeWithoutVariables->postNodeSetter(new PostNodeSetter('nodeWithoutVariables'));
     $nodeWithoutVariablesEmpty = $this->addVariable(new EncoderNodeVariable('nodeWithoutVariablesEmpty'));
     $nodeWithoutVariablesEmpty->postNodeSetter(new PostNodeSetter('nodeWithoutVariables', array()));
     $nodeWithoutVariablesNull = $this->addVariable(new EncoderNodeVariable('nodeWithoutVariablesNull'));
     $nodeWithoutVariablesNull->postNodeSetter(new PostNodeSetter('nodeWithoutVariables', array()));
     $nodeUnknownVariable = $this->addVariable(new EncoderNodeVariable('nodeUnknownVariable'));
     $nodeUnknownVariable->postNodeSetter(new PostNodeSetter('nodeSimple', array('unknown_variable')));
     $this->addVariable(new EncoderNodeVariable('var'));
 }
Ejemplo n.º 7
0
 function __construct()
 {
     parent::__construct('thingsContainer', 'thingContainer', '\\PE\\Samples\\General');
     $this->addChildNode(new EncoderNodeChild('things', new NodeChildSetter('addThing'), new NodeChildGetter('getThings')));
 }
 function __construct()
 {
     parent::__construct('nonArrayGetterMethods', 'nonArrayGetterMethod', '\\PE\\Samples\\Erroneous');
     $this->addChildNode(new EncoderNodeChild('things', new NodeChildSetter('addThing'), new NodeChildGetter('getThings')));
 }
 function __construct()
 {
     parent::__construct('addAfterDecodeChildrenRequire', 'addAfterDecodeChildRequire', '\\PE\\Samples\\Specials');
     $name = $this->addVariable(new EncoderNodeVariable('name'));
     $name->postNodeSetter(new PostNodeSetter('nodeSetName', array(NodeAccessor::VARIABLE_VALUE, NodeAccessor::VARIABLE_PARENT)));
 }
 function __construct()
 {
     parent::__construct('noGetterMethods', 'noGetterMethod', '\\PE\\Samples\\Erroneous');
     $this->addVariable(new EncoderNodeVariable('nonExistent'));
 }
 function __construct()
 {
     parent::__construct('nonArrayGetterMethodsOnPurpose', 'nonArrayGetterMethodOnPurpose', '\\PE\\Samples\\Specials');
     $things = $this->addChildNode(new EncoderNodeChild('things', new NodeChildSetter('addThing'), new NodeChildGetter('getThing')));
     $things->isArray(false);
 }
 function __construct()
 {
     parent::__construct('addAfterDecodeChildren', 'addAfterDecodeChild', '\\PE\\Samples\\Specials');
     $this->addVariable(new EncoderNodeVariable('name'));
 }
Ejemplo n.º 13
0
 function __construct($classPrepend = null, $nodeTypeName = null)
 {
     parent::__construct('animals', 'animal', $classPrepend !== null ? $classPrepend : '\\PE\\Samples\\Farm', $nodeTypeName);
     $this->addVariable(new EncoderNodeVariable('type'));
     $this->addVariable(new EncoderNodeVariable('name'));
 }
Ejemplo n.º 14
0
 function __construct()
 {
     parent::__construct('singleChildren', 'singleChild', '\\PE\\Samples\\Specials');
     $thing = $this->addChildNode(new EncoderNodeChild('thing', new NodeChildSetter('setThing'), new NodeChildGetter('getThing')));
     $thing->isArray(false);
 }
Ejemplo n.º 15
0
 function __construct($nodeTypeName = null)
 {
     parent::__construct('hasDefaultTypes', 'hasDefaultType', '\\PE\\Samples\\Specials', $nodeTypeName);
 }
Ejemplo n.º 16
0
 function __construct()
 {
     parent::__construct('farms', 'farm', '\\PE\\Samples\\Farm');
     $this->addChildNode(new EncoderNodeChild('buildings', new NodeChildSetter('addBuilding'), new NodeChildGetter('getBuildings')));
 }
Ejemplo n.º 17
0
 function __construct()
 {
     parent::__construct('hello-worlds', 'hello-world', null);
     $this->addVariable(new EncoderNodeVariable('foo'));
 }
Ejemplo n.º 18
0
 function __construct()
 {
     parent::__construct('things', 'thing', '\\PE\\Samples\\General');
     $this->addVariable(new EncoderNodeVariable('thingVar'));
 }
Ejemplo n.º 19
0
 function __construct($setupLoader)
 {
     parent::__construct('classLoaders', 'classLoader', '\\PE\\Samples\\Loader');
     $this->setupLoader = $setupLoader;
 }
Ejemplo n.º 20
0
 function __construct($overrideObjectFileName = true)
 {
     parent::__construct('encoderNodeLoaders', 'encoderNodeLoader', '\\PE\\Samples\\Erroneous');
     $this->overrideObjectFileName = $overrideObjectFileName;
 }
Ejemplo n.º 21
0
 function __construct()
 {
     parent::__construct('requiredVariables', 'requiredVariable', '\\PE\\Samples\\Specials');
     $thing = $this->addVariable(new EncoderNodeVariable('required'));
     $thing->getObjectSetter()->required(true);
 }
Ejemplo n.º 22
0
 function __construct()
 {
     parent::__construct('optionalVariables', 'optionalVariables', '\\PE\\Samples\\Specials');
     $this->addVariable(new EncoderNodeVariable('name'));
     $this->addVariable(new EncoderNodeVariable('otherVariable'));
 }