public function inject($instance, ApplicationContext $context, BeanDefinition $bean) { if ($this->name == '') { throw new IocException("a property have no name in the bean ({$bean->getId()})"); } if ($this->value) { $value = $value = $this->getValueProperty($context, $this->value); } elseif ($this->ref) { $value = ContainerFactory::getBean($this->ref); } else { $value = null; } $this->injectProperty($instance, $value, $bean); }
public function inject($instance, ApplicationContext $context, BeanDefinition $bean) { $value = ContainerFactory::getBean($this->ref); $setter = $this->name; $instance->{$setter}($value); }
public function testSetterWithPrivate() { $test = ContainerFactory::getBean('test3'); $this->assertEquals(666, $test->getPriv()); }
public function inject($instance, ApplicationContext $context, BeanDefinition $bean) { $value = ContainerFactory::getBean($this->ref); $propertyName = $this->name; $instance->{$propertyName} = $value; }