Skip to content

Instantly share code, notes, and snippets.

View CarlosEduardo's full-sized avatar

Carlos Eduardo CarlosEduardo

View GitHub Profile
<?php
// "NativeQuery" like http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/native-sql.html
$nativeQuery = 'SELECT user.id AS id, user.name AS name, address.id AS address_id, address.street AS street, address.city AS city ' .
'FROM user INNER JOIN address ON address.id = user.address_id ' .
'WHERE user.name = :name';
$atlas
->nativeQuery($nativeQuery)
<?php
namespace Application;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="documents")
* @ORM\HasLifecycleCallbacks
@CarlosEduardo
CarlosEduardo / Doctrine-Multi-Tenancy.md
Last active June 19, 2024 14:36
Multi-Tenancy (tenant) Strategy for Doctrine ORM
@CarlosEduardo
CarlosEduardo / Module.php
Last active May 11, 2016 17:03
Arquivo I18n para mensagens de erro no Zend Framework 2
<?php
namespace Application;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$translator = new Zend\Mvc\I18n\Translator(new Zend\I18n\Translator\Translator());