public function buildForm(\Symfony\Component\Form\FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder->add('references', 'text', array('attr' => array('placeholder' => 'ID oferty', 'pattern' => '\\d+'), 'data' => $this->getReferences(), 'required' => false)); $builder->add('created_at', 'text', array('attr' => array('placeholder' => 'Data utworzenia', 'pattern' => '\\d{2}.\\d{2}.\\d{4}'), 'data' => $this->getCreatedAt(), 'required' => false)); $builder->add('status', 'choice', array('choices' => \DataBundle\Entity\Offer::GetStatuses(), 'placeholder' => 'Wybierz status', 'required' => false, 'data' => $this->getStatus(), 'attr' => array('pattern' => '\\d+'))); }
public function rejectByOfferAccepted(Offer $objOffer) { $this->createQueryBuilder('o')->update()->set('o.status', Offer::STATUS_REJECTED)->where('o.id <> :id')->setParameter(':id', $objOffer->getId())->andWhere('o.credit = :credit')->setParameter('credit', $objOffer->getCredit())->getQuery()->execute(); }
public function getToRejectByOfferAccepted(\DataBundle\Entity\Offer $objOffer) { return $this->createQueryBuilder('g')->select('g')->leftJoin('g.offers', 'o')->where('o.id <> :id')->setParameter(':id', $objOffer->getId())->andWhere('o.credit = :credit')->setParameter('credit', $objOffer->getCredit())->getQuery()->getResult(); }