1.) find() is only for finding by identifier now
$article = $dm->find('Article', array('title' => 'test'))
to
$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));
2.) Query builder change:
1.) find() is only for finding by identifier now
$article = $dm->find('Article', array('title' => 'test'))
to
$article = $dm->getRepository('Article')->findBy(array('title' => 'test'));
2.) Query builder change:
| <?php | |
| namespace Hydrators; | |
| use Doctrine\ODM\MongoDB\DocumentManager; | |
| use Doctrine\ODM\MongoDB\Mapping\ClassMetadata; | |
| use Doctrine\ODM\MongoDB\Hydrator\HydratorInterface; | |
| use Doctrine\ODM\MongoDB\UnitOfWork; | |
| /** |
| $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( |
| 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); | |
| } |
| Employee: | |
| columns: | |
| id: | |
| type: integer | |
| primary: true | |
| autoincrement: true | |
| sf_guard_user_id: | |
| type: integer | |
| name: | |
| type: string(155) |
| Employee: | |
| columns: | |
| id: | |
| type: integer | |
| primary: true | |
| autoincrement: true | |
| sf_guard_user_id: | |
| type: integer | |
| start_date: | |
| type: date |
| sfGuardUser: | |
| user_employee1: | |
| username: employee1 | |
| password: changeme | |
| Department: | |
| dev: | |
| title: Development | |
| Employee: |
| 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; | |
| } |
| <?php | |
| // create SoftDeleteManager | |
| $sdm = new SoftDeleteManager($dm); | |
| // Soft delete a few documents | |
| $sdm->delete($user); | |
| $sdm->delete($product); | |
| $sdm->delete($seller); |
| <?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; |