This topic contains 1 reply, has 1 voice, and was last updated by mlozynskyy 6 years, 10 months ago.
- Topic
Hello,
I need to extend Product Entity:12345678910111213141516/*** {@inheritdoc}*/public function up(Schema $schema, QueryBag $queries){$this->extendExtension->addOneToManyRelation($schema,'oro_product','attribute','product_attribute_value_varchar',['value'],['value'],['value'],['extend' => ['owner' => ExtendScope::OWNER_CUSTOM, 'without_default' => true]]);}Entity:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475/*** @ORM\Entity()* @ORM\Table(name="product_attribute_value_varchar")* @Config*/class ProductAttributeValueVarchar{/*** @ORM\Id* @ORM\GeneratedValue(strategy="AUTO")* @ORM\Column(type="integer")*/private $id;/*** @var ProductAttribute** @ORM\ManyToOne(targetEntity="Divante\Bundle\ProductAttributeBundle\Entity\ProductAttribute")* @ORM\JoinColumn(name="prod_attr_id", referencedColumnName="id", onDelete="SET NULL")*/private $attribute;/*** @ORM\Column(type="string")*/private $value;/*** @return mixed*/public function getId(){return $this->id;}/*** @param mixed $id*/public function setId($id){$this->id = $id;}/*** @return mixed*/public function getAttribute(){return $this->attribute;}/*** @param mixed $attribute*/public function setAttribute($attribute){$this->attribute = $attribute;}/*** @return mixed*/public function getValue(){return $this->value;}/*** @param mixed $value*/public function setValue($value){$this->value = $value;}}After $product->getAttribute(), and collection init, a get an error:
1234567Undefined index: product_attribute in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php on line 1768PHP Warning: Invalid argument supplied for foreach() in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php on line 1773PHP Notice: Undefined index: product_attribute in /var/www/vendor/doctrine/orm/lib/Doctrine/ORM/PersistentCollection.php on line 169[Symfony\Component\Debug\Exception\FatalThrowableError]Call to a member function setValue() on nullCould You help me?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The forum ‘OroPlatform’ is closed to new topics and replies.