Exemplo n.º 1
0
 /**
  * Declares an association between this object and a Shop object.
  *
  * @param      Shop $v
  * @return     ShopVitrin The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setShop(Shop $v = null)
 {
     if ($v === null) {
         $this->setShopId(NULL);
     } else {
         $this->setShopId($v->getId());
     }
     $this->aShop = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the Shop object, it will not be re-added.
     if ($v !== null) {
         $v->addShopVitrin($this);
     }
     return $this;
 }
 /**
  * @param Shop $shop
  *
  * @return bool
  */
 public function haveShop(Shop $shop)
 {
     foreach ($this->shops as $existedShop) {
         if ($existedShop->getId() === $shop->getId()) {
             return true;
         }
     }
     return false;
 }
Exemplo n.º 3
0
 /**
  * @corvers InakaPhper\Lunchlog\Entity\Shop::setId
  * @corvers InakaPhper\Lunchlog\Entity\Shop::getId
  */
 public function testSetIdAndGetId()
 {
     $this->entity->setId(20);
     $this->assertEquals(20, $this->entity->getId());
 }