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
class DDC1020OrderEventListener | |
{ | |
public function preUpdate(LifecycleEventArgs $args) | |
{ | |
$order = $args->getEntity(); | |
$order->tax = 100; | |
$em = $args->getEntityManager(); | |
$uow = $em->getUnitOfWork(); | |
$uow->recomputeSingleEntityChangeSet( | |
$em->getClassMetadata(get_class($order)), |
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
public function register() | |
{ | |
// ... | |
$user = new User(); | |
$form = new RegisterForm('register', $user, $validator); | |
$form->bind($request, $user); | |
if ($form->isValid()) { | |
$newUser = new NewUser($user); |
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 MyCompany\Bundle\MyBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\Command; | |
use Symfony\Component\Console\Input\InputArgument; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\HttpFoundation\Request; |
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 | |
// create SoftDeleteManager | |
$sdm = new SoftDeleteManager($dm); | |
// Soft delete a few documents | |
$sdm->delete($user); | |
$sdm->delete($product); | |
$sdm->delete($seller); |
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
server { | |
expires 1M; | |
listen 80; | |
root /var/www/vhosts/sociallynotable.com/socially-notable/web; | |
index index.php; | |
if ($host ~* ^www.(.*)) { | |
set $remove_www $1; | |
rewrite ^(.*)$ http://$remove_www$1 permanent; | |
} |
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
sfGuardUser: | |
user_employee1: | |
username: employee1 | |
password: changeme | |
Department: | |
dev: | |
title: Development | |
Employee: |
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
Employee: | |
columns: | |
id: | |
type: integer | |
primary: true | |
autoincrement: true | |
sf_guard_user_id: | |
type: integer | |
start_date: | |
type: date |
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
Employee: | |
columns: | |
id: | |
type: integer | |
primary: true | |
autoincrement: true | |
sf_guard_user_id: | |
type: integer | |
name: | |
type: string(155) |
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
if ($filter !== null) { | |
if ($filter->current) { | |
$expr = $qb->expr()->field('special.startDate')->lte($date) | |
->field('special.endDate')->gte($date); | |
$qb->addOr($expr); | |
} | |
if ($filter->upcoming) { | |
$expr = $qb->expr()->field('special.startDate')->gt($date); | |
$qb->addOr($expr); | |
} |
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
$path = sfConfig::get('sf_upload_dir').'/tracks/'; | |
$fp = fopen($path.$track->getTeaserFile(), 'a+'); | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, 'http://www.musicalturk.com/teaser.php'); | |
curl_setopt($ch, CURLOPT_HEADER, 0); | |
curl_setopt($ch, CURLOPT_BUFFERSIZE, 256); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); | |
curl_setopt($ch, CURLOPT_POST, true); $post = array( |