setName() публичный Метод

public setName ( $name )
Пример #1
0
 public function createProduct()
 {
     $product = new ECommerceProduct();
     $product->setName('Doctrine Cookbook');
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
     return $product->getId();
 }
 protected function _createFixture()
 {
     $product = new ECommerceProduct();
     $product->setName('Php manual');
     $shipping = new ECommerceShipping();
     $shipping->setDays('1');
     $product->setShipping($shipping);
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
 }
Пример #3
0
 public function testLazyLoadsFieldValuesFromDatabase()
 {
     $product = new ECommerceProduct();
     $product->setName('Doctrine Cookbook');
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
     $id = $product->getId();
     $productProxy = $this->_factory->getProxy('Doctrine\\Tests\\Models\\ECommerce\\ECommerceProduct', array('id' => $id));
     $this->assertEquals('Doctrine Cookbook', $productProxy->getName());
 }
Пример #4
0
 public function testDoNotInitializeProxyOnGettingTheIdentifierAndReturnTheRightType()
 {
     $product = new ECommerceProduct();
     $product->setName('Doctrine Cookbook');
     $shipping = new ECommerceShipping();
     $shipping->setDays(1);
     $product->setShipping($shipping);
     $this->_em->persist($product);
     $this->_em->flush();
     $this->_em->clear();
     $id = $shipping->getId();
     $product = $this->_em->getRepository('Doctrine\\Tests\\Models\\ECommerce\\ECommerceProduct')->find($product->getId());
     $entity = $product->getShipping();
     $this->assertFalse($entity->__isInitialized__, "Pre-Condition: Object is unitialized proxy.");
     $this->assertEquals($id, $entity->getId());
     $this->assertSame($id, $entity->getId(), "Check that the id's are the same value, and type.");
     $this->assertFalse($entity->__isInitialized__, "Getting the identifier doesn't initialize the proxy.");
 }
 /**
  * @group DDC-762
  */
 public function testNullForeignKey()
 {
     $product = new ECommerceProduct();
     $product->setName('Doctrine 2 Manual');
     $this->_em->persist($product);
     $this->_em->flush();
     $product = $this->_em->find(get_class($product), $product->getId());
     $this->assertNull($product->getShipping());
 }