Skip to content

Instantly share code, notes, and snippets.

View erop's full-sized avatar

Egor Ushakov erop

View GitHub Profile
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use MyVendor\Contracts\Entity\VehicleInterface;
use MyVendor\Contracts\Entity\VehicleOwnerInterface;
@erop
erop / services.xml
Created March 23, 2020 11:15
Try to setup scoped HttpClient in services.xml
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xmlns="http://symfony.com/schema/dic/services"
xsi:schemaLocation="http://symfony.com/schema/dic/services
http://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony
https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
<services>
florianv_swap:
cache:
type: psr16_cache_apcu
ttl: 86400
@erop
erop / AbstractObject.php
Last active August 8, 2017 07:40
How to let PhpStorm to know more about my static methods?
<?php
abstract class AbstractObject
{
// we use static var to enforce setting up entry point
// in child classes
public static $entryPoint = null;
public static function getEntryPoint()
<?php
// this file is upgrade safe
// location: custom/modules/Contacts/views/view.detail.php
require_once('modules/Contacts/views/view.detail.php');
class CustomContactsViewDetail extends ContactsViewDetail {
/**
* @see SugarView::display()
@erop
erop / gist:935573
Created April 21, 2011 21:55 — forked from jmertic/gist:825943
PHP: Check if SugarCRM record is new
<?php
if (!empty($bean->fetched_row['id'])) {
// Do custom logic
}