Skip to content

Instantly share code, notes, and snippets.

@zgoniaiko
zgoniaiko / Concrete.php
Last active July 9, 2019 01:26
extends an abstract class and implements an interface
<?php
interface NameInterface
{
public function getName();
}
abstract class ValueObject implements NameInterface
{
protected $name;
@zgoniaiko
zgoniaiko / App\Entity\MyMax.php
Last active October 5, 2018 14:46
Function to find the maximum value in a nested set of arrays
<?php
namespace App\Entity;
class MyMax
{
public function find(array $input) {
$max = null;
foreach ($input as $value) {
/^(?:(?:(?:(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t])))?(?:[a-zA-Z0-9!#\$%&'\*\+\-\/=\?\^_`\{\}\|~]+(\.[a-zA-Z0-9!#\$%&'\*\+\-\/=\?\^_`\{\}\|~]+)*)+(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))*(?:(?:(?:(?:[ \t]*(?:\r\n))?[ \t])?(\((?:(?:(?:[ \t]*(?:\r\n))?[ \t])|(?:(?:[\x01-\x08\x0B\x0C\x0E-\x19\x7F]|[\x21-\x27\x2A-\x5B\x5D-\x7E])|(?:\\[\x00-\x08\x0B\x0C\x0E-\x7F])|(?1)))*(?:(?:[ \t]*(?:\r\n))?[ \t])?\)))|(?:(?:[ \t]*(?:\r\n))?[ \t
docroot_path: <?php echo realpath(__DIR__) ?>
sys:
logos:
images_path: %docroot_path%/Public/Images/Logos
@zgoniaiko
zgoniaiko / A.php
Created April 23, 2012 20:52
Doctrine doesn't recognize related object without join
<?php
namespace Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Entity\A
*
* @Table(name="a")
<?php
class A {
public function test() {
$this->abc = 'test';
}
}
class B extends A {
public $abc;
}