Skip to content

Instantly share code, notes, and snippets.

@Orkin
Orkin / cli-config.php
Created March 30, 2018 13:38 — forked from popovserhii/cli-config.php
Integrating Doctrine 2 ORM and Migrations into Zend Expressive
<?php
/**
* config/cli-config.php
* For more details @see \DoctrineORMModule\Module
*
* Run next commands for Migrations work
* $ composer require doctrine/doctrine-orm-module
* $ composer require doctrine/migrations
*/
$container = require 'container.php';
@Orkin
Orkin / User.php
Created March 10, 2017 16:40 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
<?php
/*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY