Skip to content

Instantly share code, notes, and snippets.

View K-Phoen's full-sized avatar

Kévin Gomez K-Phoen

View GitHub Profile
@K-Phoen
K-Phoen / keybase.md
Created February 10, 2015 23:12
keybase.md

Keybase proof

I hereby claim:

  • I am K-Phoen on github.
  • I am kphoen (https://keybase.io/kphoen) on keybase.
  • I have a public key whose fingerprint is 57A4 79D4 C383 6309 2BB4 0A21 2069 4939 A2EC 0900

To claim this, I am signing this object:

@K-Phoen
K-Phoen / data_transformer.php
Last active August 29, 2015 14:15
RulerZ, specifications and Symfony are in a boat
class SpecificationToStringTransformer implements DataTransformerInterface
{
private $specificationClass;
private $valuePath;
private $accessor;
public function __construct($specificationClass, $valuePath)
{
$this->specificationClass = $specificationClass;
$this->valuePath = $valuePath;
; behaviors
propel.behavior.default = symfony,symfony_i18n
;propel.behavior.symfony.class = plugins.sfPropelPlugin.lib.behavior.SfPropelBehaviorSymfony
propel.behavior.symfony_i18n.class = plugins.sfPropelPlugin.lib.behavior.SfPropelBehaviorI18n
propel.behavior.symfony_i18n_translation.class = plugins.sfPropelPlugin.lib.behavior.SfPropelBehaviorI18nTranslation
propel.behavior.symfony_behaviors.class = plugins.sfPropelPlugin.lib.behavior.SfPropelBehaviorSymfonyBehaviors
propel.behavior.symfony_timestampable.class = plugins.sfPropelPlugin.lib.behavior.SfPropelBehaviorTimestampable
Poc:
test:
message: Message
author: Kevin
plus: 12
minus: 1
created_at: 2011-10-10
<?php
/**
* Base class that represents a row from the 'poc' table.
*
*
*
* This class was autogenerated by Propel 1.5.6 on:
*
<?php
class BookQuery extends BaseBookQuery
{
public function recent($nb_max = 5)
{
return $this
->orderByPublishedAt('desc')
->limit($nb_max);
}
[vagrant@vagrant-debian-squeeze:~/www/project on develop]
% ./app/console propel:model:build
PHP Fatal error: Class 'FOS\UserBundle\Propel\om\BaseUserQuery' not found in /home/vagrant/www/project/vendor/friendsofsymfony/user-bundle/FOS/UserBundle/Propel/UserQuery.php on line 17
PHP Stack trace:
PHP 1. {main}() /home/vagrant/www/project/app/console:0
PHP 2. Symfony\Component\Console\Application->run() /home/vagrant/www/project/app/console:22
PHP 3. Symfony\Bundle\FrameworkBundle\Console\Application->doRun() /home/vagrant/www/project/vendor/symfony/symfony/src/Symfony/Component/Console/Application.php:106
PHP 4. Symfony\Bundle\FrameworkBundle\Console\Application->registerCommands() /home/vagrant/www/project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:68
PHP 5. Symfony\Component\HttpKernel\Kernel->boot() /home/vagrant/www/project/vendor/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Console/Application.php:83
PHP 6. Symfony\Component\HttpKernel\Kernel->initi
@K-Phoen
K-Phoen / RouterMatchCommand.php
Created June 13, 2013 12:20
Little improvement to the Symfony router:match command
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@K-Phoen
K-Phoen / autoload_composer.json
Last active December 20, 2015 09:29
Introduction à Composer - Partie 2
{
"require": {
"propel/propel-service-provider": ">=0.0.1",
"propel/propel1": "1.6.*",
"silex/silex": "1.0.*",
"symfony/validator": "2.1.*",
"willdurand/hateoas": "0.0.*",
"symfony/property-access": "2.2.*",
"symfony/yaml": "2.2.*",
"jms/metadata": "1.2.*",
@K-Phoen
K-Phoen / Replace.php
Created July 29, 2013 22:21
MySQL REPLACE() for Doctrine2
<?php
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\Parser;
use Doctrine\ORM\Query\SqlWalker;
/**
* REPLACE(str, from_str, to_str)