This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $accept = $headers->get('Accept'); | |
| $match = $accept->match('application/json, application/javascript, application/rss+xml, application/atom+xml'); | |
| var_dump($match); | |
| object(Zend\Http\Header\Accept\FieldValuePart\AcceptFieldValuePart)[301] | |
| private 'internalValues' (Zend\Http\Header\Accept\FieldValuePart\AbstractFieldValuePart) => | |
| object(stdClass)[302] | |
| public 'typeString' => string '*/*' (length=3) | |
| public 'type' => string '*' (length=1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| goal = get filtermanager to act as plugin manager and have invokables and factories for all of the assetic filters and thus have a generic way to configure those filters. | |
| a call to | |
| $filterManager->setFilters($path, AssetInterface $asset) | |
| must be able to hanlde the following configuration settings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace SndCompositionTool\Form; | |
| use SndCompositionTool\Entity\PreOrder as PreOrderEntity; | |
| use Zend\Form\Form; | |
| use Zend\InputFilter\InputFilter; | |
| use Zend\InputFilter\InputFilterProviderInterface; | |
| use Zend\Stdlib\Hydrator\ObjectProperty as Hydrator; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @return array | |
| */ | |
| public function getInputFilterSpecification() | |
| { | |
| $hostname = new \Zend\Validator\Hostname(); | |
| $hostname->setMessages( | |
| array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace SndAdmin\Entity; | |
| use Doctrine\ORM\Mapping as ORM; | |
| use ZfcUser\Entity\UserInterface; | |
| /** | |
| * @ORM\Entity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace SndAdmin\Service\Form; | |
| use Zend\ServiceManager\FactoryInterface; | |
| use Zend\ServiceManager\ServiceLocatorInterface; | |
| use Zend\Form\FormFactoryAwareInterface; | |
| use Zend\Form\Factory; | |
| use SndAdmin\Form\DealerForm as Form; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function findAround(Point $point, $radius = 1) { | |
| $em = $this->getEntityManager(); | |
| $qb = $em->createQueryBuilder(); | |
| $qb->select('m as marker, (DISTANCE(m.location, POINT_STR(:point))) as distance') | |
| ->from('SndSpecialistLocator\Entity\Marker', 'm') | |
| ->where('DISTANCE(m.location, POINT_STR(:point)) < :distance') | |
| ->setParameter('point', $point) | |
| ->orderBy('distance', 'ASC') | |
| ->setParameter('distance', $radius); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| When an accountNumber has been changed in the form it must be validated for uniqueness. This unique validator can't be used when the value hasn't been modified, because the value isn't unique then... I'm aware that I might write a custom validator, but my question is how do you handle dynamic input filtering on a form. A form for new record probably has different filters then while modifying. | |
| I'm also aware of the validation groups, do those help in this situation? | |
| function editAction() { | |
| ... | |
| if ($this->getRequest()->isPost()) { | |
| $form->setData($this->getRequest()->getPost()); | |
| if ($entity->getAccountNumber() != $form->get('dealer')->get('accountNumber')->getValue()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function fetchQuery(\Zend\Http\PhpEnvironment\Request $request = null) { | |
| $qb = $this->_em->createQueryBuilder(); | |
| $qb->select('entity, contact, address') | |
| ->from('SndAdmin\Entity\Dealer', 'entity') | |
| ->leftJoin('entity.contact', 'contact' ) | |
| ->leftJoin('entity.shippingAddress', 'address' ); | |
| if (isset($options['offset'])) { | |
| $qb->setFirstResult( $options['offset'] ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $user = new \SndAdmin\Entity\User(); | |
| $role = new \SndAdmin\Entity\UserRole(); | |
| $role->setRole('loser'); | |
| $user->setRole($role); | |
| $em->persist($user); | |
| $em->flush(); |