Skip to content

Instantly share code, notes, and snippets.

<?php
class OrderFoundViewModel
{
public $orderId;
public $orderCreationDate;
public $total;
public $state;
public $items = array();
ansible-playbook app/config/deploy/deploy.yml -i app/config/deploy/hosts.ini -e "symfony2_project_release=1"
---
- hosts: prod_server
vars:
symfony2_project_name: project_name
symfony2_project_root: /path/to/project/root
symfony2_project_repo: git repository url (i.e from github or bitbucket)
symfony2_project_branch: git repository that you want deploy
ansible_ssh_user: ssh user that ansible use for connection
symfony2_project_env: prod
symfony2_project_console_opts: ''
[prod_server]
162.x.x.x #your ip address
ansible-galaxy install servergrove.symfony2 -p YOUR_SYMFONY_PROJECT/app/config/deploy #path location is your choice
//controller
public function indexAction(Request $request)
{
//retrieve collection of question i.e from a json
...
$survey = new Survey();
class Survey
{
...
/**
* @ORM\OneToMany(targetEntity="Question", mappedBy="survey", cascade="persist")
**/
private $questions;
...
<?php
// the connection configuration
$dbParamsMaster = array(
'driver' => 'pdo_mysql',
'user' => 'ideato',
'password' => 'ideato',
'dbname' => 'db_ideato',
);
<?php
$conn = \Doctrine\DBAL\DriverManager::getConnection(array(
'wrapperClass' => 'Doctrine\DBAL\Connections\MasterSlaveConnection',
'driver' => 'pdo_mysql',
'keepSlave' => true,
'master' => array(
'user' => 'ideato',
'password' => 'ideato',
'dbname' => 'db_ideato'
<?php
$container = new Navigation(array(
array(
'label' => 'Customers',
'class' => 'dropdown-toggle',
'uri' => '#',
'pages' => array(
array(
'label' => 'View all customers',