Skip to content

Instantly share code, notes, and snippets.

@zluiten
zluiten / default.conf
Last active October 30, 2015 13:56
nginx config - dynamic virtual hosts
server {
server_name *.dev;
index index.php;
set $basepath "/home/username/dev";
set $domain $host;
# check one name domain for simple application
<?php
return is_object($changeSet) && $changeSet->hasChangedField($fieldName) && $refProp->getValue($entity) == array_shift($values);
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:80 127.0.1.1 (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex rewrite-map: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
<?php
class SomeController extends AbstractController
{
protected $someService;
public function indexAction()
{
$service = $this->getSomeService();
}
<?php
$display = $this->getProxy()->getObjectManager()->getClassMetadata(
$this->getProxy()->getTargetClass()
)->getFieldValue($entity, $property);
<?php
public function configureObjectManagerForOneToManyEntity()
{
//snip
$this->hydratorByValue = $this->getMock(
'DoctrineModule\Stdlib\Hydrator\DoctrineObject',
null,
array($this->objectManager, 'DoctrineModuleTest\Stdlib\Hydrator\Asset\OneToManyEntity', true)
);
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace Application\Controller;
<?php
namespace Application\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
*/
Your requirements could not be resolved to an installable set of packages.
Problem 1
- doctrine/doctrine-orm-module dev-hotfix/auth-factory-build requires doctrine/migrations dev-master -> no matching package found.
- doctrine/doctrine-orm-module dev-form/select requires doctrine/migrations dev-master -> no matching package found.
- doctrine/doctrine-orm-module 0.5.1 requires doctrine/migrations dev-master -> no matching package found.
- doctrine/doctrine-orm-module 0.5.0 requires doctrine/migrations dev-master -> no matching package found.
- doctrine/doctrine-orm-module 0.4.0 requires doctrine/doctrinemodule dev-master -> no matching package found.
- doctrine/doctrine-orm-module 0.3.1 requires doctrine/doctrinemodule 0.3.1 -> no matching package found.
- doctrine/doctrine-orm-module 0.3.0 requires doctrine/doctrinemodule dev-master -> no matching package found.
@zluiten
zluiten / gist:3349535
Created August 14, 2012 14:06
Set hydrator recursive
public class someForm extends Form {
public function setHydrator(\Zend\Stdlib\Hydrator\HydratorInterface $hydrator) {
parent::setHydrator($hydrator);
$this->setHydratorRecursive($hydrator, $this);
}
protected function setHydratorRecursive($hydrator, $fieldset) {
$nextfieldsets = $fieldset->getFieldsets();
foreach ($nextfieldsets as $nextfieldset) {
$nextfieldset->setHydrator($hydrator);