This file contains hidden or 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 | |
/** | |
* This class is used as date_class in form component | |
*/ | |
class CalculationCommand | |
{ | |
const BASIC_TYPE = 'basic_calculaction_type'; | |
public $subTotal; |
This file contains hidden or 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 AppBundle\Tests; | |
use SimpleBus\Message\Bus\MessageBus; | |
use SimpleBus\Message\Recorder\PublicMessageRecorder; | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Component\Console\Output\ConsoleOutput; |
This file contains hidden or 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 AppBundle\Twig\Extension; | |
use Symfony\Component\HttpFoundation\File\File; | |
use Symfony\Component\HttpKernel\KernelInterface; | |
/** | |
* Usage example, | |
* <img src="{{ data_uri('@AcmeBundle/Resources/public/images/logo.svg') }}"> |
This file contains hidden or 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
# services to handle doctrine extensions | |
# import it in config.yml | |
services: | |
# KernelRequest listener | |
# extension.listener: | |
# class: AppBundle\Listener\DoctrineExtensionListener | |
# calls: | |
# - [ setContainer, [ @service_container ] ] | |
# tags: | |
# # translatable sets locale after router processing |
This file contains hidden or 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 MoneyType extends AbstractType implements DataMapperInterface | |
{ | |
public function buildForm(FormBuilder $builder, array $options) | |
{ | |
$builder | |
->add('amount', 'integer') | |
->add('currency', 'string') | |
->setDataMapper($this) | |
; | |
} |
This file contains hidden or 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 Acme\DemoBundle\EventListener; | |
use Symfony\Component\Routing\RouterInterface; | |
class ConsoleListener | |
{ | |
/** | |
* @var RouterInterface |
This file contains hidden or 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 Dpanel\Bundle\AdminBundle\Forms; | |
use Cwd\GenericBundle\Doctrine\EntityRepository; | |
use Symfony\Component\Form\AbstractType; | |
use Symfony\Component\Form\FormBuilderInterface; | |
use JMS\DiExtraBundle\Annotation as DI; | |
use Symfony\Component\OptionsResolver\OptionsResolverInterface; |
This file contains hidden or 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 | |
use Doctrine\Common\DataFixtures\Executor\ORMExecutor; | |
use Doctrine\Common\DataFixtures\Purger\ORMPurger; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Symfony\Bridge\Doctrine\DataFixtures\ContainerAwareLoader as Loader; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; |
This file contains hidden or 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 | |
final class EmailValueObject | |
{ | |
private $mailbox; | |
private $host; | |
public function __construct($email) | |
{ | |
if (false === strpos($email, '@')) { |
This file contains hidden or 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 | |
... | |
class BlablaAdmin extends Admin | |
{ | |
... | |
public function createQuery($context = 'list') | |
{ | |
$query = parent::createQuery($context); | |
$em = $query->getQueryBuilder()->getEntityManager(); |