/** * {@inheritDoc} */ public function setSupplier($supplier) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setSupplier', array($supplier)); return parent::setSupplier($supplier); }
/** * @expectedException \InvalidArgumentException */ public function testCanReAssignWithAnotherIdThrowsExceptionManyToOne() { $article = new Article(); $supplier = new \Shopware\Models\Article\Supplier(); $supplier->setName("test"); $supplier->setDescription('description'); $this->setProperty($supplier, 'id', 1); $article->setSupplier($supplier); $this->assertSame($supplier, $article->getSupplier()); $data = array('supplier' => array('id' => '2', 'name' => 'foo')); $article->fromArray($data); }