Skip to content

Instantly share code, notes, and snippets.

View aronkerr's full-sized avatar

Aron Kerr aronkerr

View GitHub Profile
@aronkerr
aronkerr / Application.Entity.Brand.php
Last active January 22, 2021 10:30
ZF2 Form Collection Validation - Unique
<?php
namespace Application\Entity
class Brand
{
/**
* @var string
\*/
protected $name;
@aronkerr
aronkerr / original.sql
Last active November 23, 2017 04:28
ZF2 Sql Exists sub query using ZF2 query helpers
SELECT *
FROM SOME_TABLE_ONE STO
WHERE EXISTS (
SELECT *
FROM SOME_TABLE_TWO STT
WHERE STO.STT_ID = STT.ID
)
@aronkerr
aronkerr / gist:6196421
Last active December 20, 2015 21:18
Zend Framework 2 - Setup Oracle DB connection
<?PHP
return array(
'adapters' => array(
'db' => array(
'connection1' => array(
'driver' => 'Oci8',
'connection' => 'orcl',
'username' => 'username',
'password' => 'password',
@aronkerr
aronkerr / gist:6196208
Last active December 20, 2015 21:18
Get individual form elements from ZF2 collection
<?php
// Itterate over the collection and grap the elements
foreach($form->get('collectionName')->getIterator() as $fieldset)
{
echo $this->formRow($fieldset->get('elementName'));
echo $this->formRow($fieldset->get('elementAnotherElementName'));