This file contains 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
# Example. A category entity with a url friendly 'slug' | |
# we want to index on this slug because we will be using it | |
# to query with. | |
Vendor\CategoryBundle\Entity\Category: | |
type: entity | |
table: category | |
indexes: | |
# the name of the index | |
category_slug_idx: |
This file contains 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
# EXPORTS FILE (OSX) | |
# | |
# /etc/exports | |
# | |
# You can change the directory to wherever | |
# you store your project files | |
/Users/user_name/code -alldirs -mapall=501:501 | |
# EXPORTS FILE (ubuntu 11.04) | |
# |
This file contains 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
var express = require('express'), | |
graph = require('fbgraph'), | |
oauth = require('oauth'); | |
var app = module.exports = express.createServer(); | |
var twConfig = { | |
consumer_key: 'CONSUMER_KEY', | |
consumer_secret: 'CONSUMER_SECRET', | |
request_token_url: 'https://api.twitter.com/oauth/request_token', |
This file contains 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 Vendor\Prefix\Repository; | |
use Doctrine\ORM\EntityRepository; | |
class ProductRepository extends EntityRepository | |
{ | |
public function find($id) | |
{ |
This file contains 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 | |
function paginate(Doctrine\ORM\Query $query, $page, $limit, $fetchJoinCollection = true) | |
{ | |
// If we don't have a page just return the result | |
if( ! $page && ! $limit) | |
{ | |
return $query->getResult(); | |
} |
This file contains 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 | |
class Foo | |
{ | |
private $_em; | |
public function __construct($entity_manager) | |
{ | |
$this->_em = $entityManager; | |
} |
This file contains 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 | |
$articles = $article_repository->findAll(); | |
foreach($articles as $article) | |
{ | |
echo $article->getTitle(); | |
echo count($article->getComments()); | |
} |
This file contains 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 | |
// src/Vendor/SomeBundle/Controller/SomeController.php | |
namespace Vendor\SomeBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller, | |
Symfony\Component\HttpFoundation\Request; | |
class SomeController extends Controller |
This file contains 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
# This custom task for deploying a Symfony 2 application is set to run after deploy:setup | |
# is executed. It interactively ask a user for database details to create a parameters.ini | |
# thus avoiding having to manually on to the server and create it | |
# | |
# Helper function from http://stackoverflow.com/a/1662001/1041885 | |
# | |
# Interactive parameter.ini generation adapted from http://adurieux.blogspot.co.uk/2011/10/using-capistrano.html | |
# ... | |
# ... Your deployment settings/tasks |
This file contains 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
# ../application/configs/application.ini | |
resources.doctrine.dbal.connections.default.sqlLoggerClass = "Doctrine\DBAL\Logging\DebugStack" | |
ZFDebug = 1 |
OlderNewer