Skip to content

Instantly share code, notes, and snippets.

View bitwombat's full-sized avatar

Bit Wombat bitwombat

View GitHub Profile
<?php
// bootstrap.php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
// Create a simple "default" Doctrine ORM configuration for Annotations
$isDevMode = true;
echo __DIR__."/module/UfAdminLibraryModule/src/";
@bitwombat
bitwombat / WorkerControllerTest.php
Created February 5, 2017 01:01
merge/overrides don't seem to be working correctly...
public function setUp()
{
// The module configuration should still be applicable for tests.
// You can override configuration here with test case specific values,
// such as sample view templates, path stacks, module_listener_options,
// etc.
$configOverrides = [
@bitwombat
bitwombat / EventRepository_v1.php
Last active August 6, 2017 05:50
Different queries, same result. Any reason to care?
$qb ->from('Event e')
->where($qb->expr()->isMemberOf(':personId', 'e.peopleAttending'))
->setParameter('personId', 3)
;
# dpkg-query -L brhl2140lpr
/.
/usr
/usr/share
/usr/share/doc
/usr/local
/usr/local/Brother
/usr/local/Brother/inf
/usr/local/Brother/inf/brHL2140rc
/usr/local/Brother/inf/setupPrintcap
@bitwombat
bitwombat / default.phtml
Last active October 5, 2017 11:25
PHPStorm/EA Extended inspections complains about this else.
if ($mustBeCurrent) {
$title = 'People currently proficient in';
} else {
$title = 'People who have ever had training in';
}
public function __set($key, $value)
{
$setter = 'set' . str_replace('_', '', $key);
if (is_callable([$this, $setter])) {
$this->{$setter}($value);
return;
}
.
<?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" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity repository-class="Model\Repository\CompetencyRepository" name="Model\Entity\Competency" table="competencies">
<id name="id" type="integer" column="id">
<generator strategy="IDENTITY"/>
</id>
<field name="name" type="string" column="name" precision="0" scale="0" nullable="false"/>
<field name="description" type="string" column="description" precision="0" scale="0" nullable="false"/>
<field name="mandatory" type="boolean" column="mandatory" precision="0" scale="0" nullable="false"/>
<field name="refreshFrequencyInMonths" type="integer" column="refreshFrequencyInMonths" precision="0" scale="0" nullable="false"/>
<?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" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<entity repository-class="Model\Repository\CompetencySetRepository" name="Model\Entity\CompetencySet" table="competency_sets">
<id name="id" type="integer" column="id">
<generator strategy="IDENTITY"/>
</id>
<field name="name" type="string" column="name" precision="0" scale="0" nullable="false"/>
<field name="description" type="string" column="description" precision="0" scale="0" nullable="false"/>
<many-to-many field="competencies" target-entity="Model\Entity\Competency" fetch="LAZY">
<join-table name="competencyset_competency">
@bitwombat
bitwombat / composer_output.log
Created October 1, 2018 09:42
Composer output on attempted update to phpstan/phpstan
Reading ./composer.json
Loading config file /home/gbell2/.composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/data/www/aquasafe/app): git branch --no-color --no-abbrev -v
Reading /home/gbell2/.composer/composer.json
Loading config file /home/gbell2/.composer/auth.json
Loading config file /home/gbell2/.composer/composer.json
Loading config file /home/gbell2/.composer/auth.json
Reading /home/gbell2/.composer/auth.json
{
"name": "gbell2/tmp",
"authors": [
{
"name": "Greg Bell",
"email": "greg@bitwombat.com.au"
}
],
"repositories": [
{