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
| <VirtualHost *:80> | |
| ServerName ams.local | |
| ServerAlias ams.local | |
| DocumentRoot /Library/WebServer/Documents/ams/web | |
| <Directory /Library/WebServer/Documents/ams/web/> | |
| Options Indexes FollowSymLinks MultiViews | |
| AllowOverride None | |
| Order allow,deny | |
| allow from all |
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
| $cachedirs = [ "/var/www/ams/app/cache", "/var/www/ams/app/logs" ] | |
| file { $cachedirs : | |
| ensure => directory, | |
| group => "vagrant", | |
| owner => "vagrant", | |
| mode=> 0777, | |
| recurse => true, | |
| } |
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
| file { "/var/www/ams/app/cache" : | |
| ensure => directory, | |
| group => "vagrant", | |
| owner => "vagrant", | |
| mode=> 2777, | |
| recurse => true, | |
| } | |
| file { "/var/www/ams/app/logs" : | |
| ensure => directory, |
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
| $ ps aux | grep apache | |
| 70:root 1027 0.0 1.7 370548 17972 ? Ss 13:20 0:00 /usr/sbin/apache2 -k start | |
| 71:www-data 1046 0.0 1.2 370976 12940 ? S 13:20 0:00 /usr/sbin/apache2 -k start | |
| 72:www-data 1047 0.0 0.7 370596 7272 ? S 13:20 0:00 /usr/sbin/apache2 -k start | |
| 73:www-data 1048 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start | |
| 74:www-data 1049 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start | |
| 75:www-data 1051 0.0 0.6 370580 7024 ? S 13:20 0:00 /usr/sbin/apache2 -k start | |
| 80:www-data 1617 0.0 0.6 370580 7024 ? S 13:21 0:00 /usr/sbin/apache2 -k start | |
| 87:vagrant 1826 0.0 0.0 11676 936 pts/0 S+ 13:36 0:00 grep --color=auto -in apache |
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
| protected function customizeForm($form, $previouslySelectedObject) | |
| { | |
| // create the field, this is similar the $builder->add() | |
| // field name, field type, data, options | |
| $form->add( | |
| $this->factory->createNamed( | |
| 'MyOtherEntity', | |
| 'entity', | |
| null, | |
| $formOptions = 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
| $form = $this->createForm('my_form_name', $myObject); | |
| $request = $this->getRequest(); | |
| $data = $request->request->get($form->getName()); | |
| $data['myOtherEntity'] = ''; | |
| $request->request->set($form->getName(), $data); | |
| $form->bind($request); |
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
| $qb->select("u") | |
| ->from("YourUserBundle:User", "u") | |
| ->join("u.Group", "g") | |
| ->join("g.Role", "r") | |
| ->where("r.role = :role"); | |
| $query = $qb->getQuery(); | |
| $query->setParameter("role", $role); | |
| $results = $query->getResult(); |
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
| /** | |
| * {@inheritdoc} | |
| */ | |
| public function delete($object) | |
| { | |
| try { | |
| $entityManager = $this->getEntityManager($object); | |
| $entityManager->remove($object); | |
| $entityManager->flush(); | |
| } catch (\PDOException $e) { |
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
| } catch (ModelManagerException $e) { | |
| //get details of the PDO or DBAL exeption that was actually thrown | |
| $actualException = $e->getPrevious() | |
| if ($this->isXmlHttpRequest()) { | |
| return $this->renderJson( | |
| array( | |
| 'result' => 'error', | |
| 'info' => '$actualException->getMessage(); |
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
| /** | |
| * @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException|\Symfony\Component\Security\Core\Exception\AccessDeniedException | |
| * | |
| * @param mixed $id | |
| * | |
| * @return Response|RedirectResponse | |
| */ | |
| public function deleteAction($id) | |
| { | |
| $id = $this->get('request')->get($this->admin->getIdParameter()); |