Ejemplo n.º 1
0
 /**
  * Test getter/setter for id property
  */
 public function testGetSetId()
 {
     $this->assertEmpty($this->locale->getId());
     // change value and assert new
     $newId = 5;
     $this->assertEntity($this->locale->setId($newId));
     $this->assertEquals($newId, $this->locale->getId());
 }
 /**
  * {@inheritdoc}
  */
 public function scheduleForChannelAndLocale(Channel $channel, Locale $locale)
 {
     $productQb = $this->documentManager->createQueryBuilder($this->productClass);
     $pullExpr = $productQb->expr()->addAnd($productQb->expr()->field('channel')->equals($channel->getId()))->addAnd($productQb->expr()->field('locale')->equals($locale->getId()));
     $productQb->update()->multiple(true)->field(sprintf('normalizedData.completenesses.%s-%s', $channel->getCode(), $locale->getCode()))->unsetField()->field('completenesses')->pull($pullExpr)->getQuery()->execute();
 }
 /**
  * {@inheritDoc}
  */
 public function getId()
 {
     if ($this->__isInitialized__ === false) {
         return (int) parent::getId();
     }
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'getId', array());
     return parent::getId();
 }
    /**
     * {@inheritdoc}
     */
    public function scheduleForChannelAndLocale(Channel $channel, Locale $locale)
    {
        $sql = <<<SQL
            DELETE c FROM pim_catalog_completeness c
            WHERE c.channel_id = :channel_id
            AND c.locale_id = :locale_id
SQL;
        $sql = $this->applyTableNames($sql);
        $stmt = $this->connection->prepare($sql);
        $stmt->bindValue('channel_id', $channel->getId());
        $stmt->bindValue('locale_id', $locale->getId());
        $stmt->execute();
    }