Skip to content

Instantly share code, notes, and snippets.

@cifren
cifren / ProdAvailabilityRepository.php
Last active October 7, 2016 12:55
Create a custom block with a form using ECK
<?php
class ProductAvailabilityRepository {
static function getItemIdFromProdAndRelay($productId, $relayId)
{
$dbQuery = db_query("
SELECT eck_product_availability.id AS id
FROM {eck_product_availability} eck_product_availability
LEFT JOIN {field_data_field_relay_ref} field_data_field_relay_ref
ON eck_product_availability.id = field_data_field_relay_ref.entity_id AND field_data_field_relay_ref.entity_type = 'product_availability'
@cifren
cifren / EntityStamp.php
Last active August 29, 2015 13:56
EntityStamp listener
<?php
/**
* @author Ali Tiane
*
*/
// src/App/OneBundle/Model/EntityStamp.php
namespace App\OneBundle\Model;
use Doctrine\ORM\Mapping as ORM;
@cifren
cifren / InvoiceController.php
Last active December 5, 2016 10:29
Paginator class for symfony2 Give the possibility to create pagination on symfon2 and with bootstrap3, including Doctrine management
<?php
/*Controller/InvoiceController.php*/
namespace Ruby\CheckbookBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class InvoiceController extends Controller
{
public function listAction($page)
{