Skip to content

Instantly share code, notes, and snippets.

View tworzenieweb's full-sized avatar

Łukasz Adamczewski tworzenieweb

View GitHub Profile
@tworzenieweb
tworzenieweb / ApiManager.php
Last active December 16, 2015 17:19
Using Guzzle in Symfony2
<?php
namespace Tworzenieweb\Bundle\ApiBundle\Manager;
use Symfony\Bridge\Monolog\Logger,
Symfony\Component\HttpKernel\Kernel,
Guzzle\Http\Client,
Guzzle\Plugin\CurlAuth\CurlAuthPlugin;
class ApiManager {
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gedmo="http://gediminasm.org/schemas/orm/doctrine-extensions-mapping"
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity name="Luxodo\Bundle\ProductionBundle\Entity\Category" table="category" repository-class="Gedmo\Tree\Entity\Repository\NestedTreeRepository">
<id name="id" type="integer" column="id">
<generator strategy="IDENTITY"/>
</id>
@tworzenieweb
tworzenieweb / CategoryAdmin
Created March 29, 2013 10:05
how to create doctrine tree behaviour with sonata
<?php
namespace Luxodo\Bundle\ProductionBundle\Admin;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQuery;
@tworzenieweb
tworzenieweb / Category - tree
Created March 29, 2013 10:04
how to create movable tree interface with sonata
<?php
/*
* This file is part of the Sonata package.
*
* (c) Thomas Rabaix <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@tworzenieweb
tworzenieweb / version73.php
Created March 12, 2012 09:59
Doctrine 1.2 How to drop non standard index in migration
<?php
/**
* This class has been auto-generated by the Doctrine ORM Framework
*/
class Version73 extends Doctrine_Migration_Base
{
public function up()
{
$manager = Doctrine_Manager::getInstance();