Skip to content

Instantly share code, notes, and snippets.

View ZhukV's full-sized avatar
🏠
Working from home

Vitaliy Zhuk ZhukV

🏠
Working from home
View GitHub Profile
<?php
namespace Acme\DemoBundle\Util;
use Doctrine\ORM\QueryBuilder;
/**
* Pagination
*/
class Pagination implements \Countable, \Iterator
;(function ($) {
/**
* Event for collection
*/
function CollectionEvent(element)
{
var status = true;
/**
* Get element
;(function(){
/**
* Event dispatcher system
*/
function EventDispatcher()
{
var _listeners = {};
/**
* Add listener
@ZhukV
ZhukV / Box.php
Created May 22, 2013 07:15
Scale & crop filter to AvalacheImagine
<?php
namespace Acme\DemoBundle\Imagine\Filter;
use Imagine\Image\BoxInterface;
use Imagine\Image\PointInterface;
use Imagine\Image\Point;
/**
* Common box container, for allowed set width or height is zero
@ZhukV
ZhukV / AttachModel.php
Created April 26, 2013 19:41
Abstract attach model for upload files in Symfony 2
<?php
namespace Acme\DemoBundle\Model;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* Abstract class for control attachments model (Image, flash, other files)
*
* For upload files in your entity please usage ORM\HasLifecycleCallbacks (preUpdate, prePersist)