Skip to content

Instantly share code, notes, and snippets.

View samsonasik's full-sized avatar
🔥
I am doing very fast fix 🚀, sponsor me 💖 https://github.com/sponsors/samsonasik

Abdul Malik Ikhsan samsonasik

🔥
I am doing very fast fix 🚀, sponsor me 💖 https://github.com/sponsors/samsonasik
View GitHub Profile
<?php
namespace Application;
use Zend\Mvc\MvcEvent;
use Zend\Validator\AbstractValidator;
class Module
{
public function onBootstrap(MvcEvent $event)
<?php
copy(__DIR__ . '/music.db.original', __DIR__ . '/music.db');
include 'vendor/autoload.php';
return new Zend\Db\Adapter\Adapter(array(
// Sqlite Configuration
'driver' => 'Pdo',
'dsn' => 'sqlite:' . __DIR__ . '/music.db',
<?php
use Zend\Db\Sql\Select;
// basic table
$select0 = new Select;
$select0->from('foo');
// 'SELECT "foo".* FROM "foo"';
<?php
namespace MyFunnyValentine;
// Detect if the currently matched route belongs to this module.
// The assumption is that the controller name includes the module namespace.
class Module
{
public function onBootstrap($e)
<?php
namespace My\Modules\Authentication\Form;
use Zend\Form\Form;
use Zend\InputFilter\InputFilterProviderInterface;
class ChangePassword extends Form implements InputFilterProviderInterface
{
public function __construct()
@samsonasik
samsonasik / zenddbselectjoinunittest
Last active December 14, 2015 07:09 — forked from robertbasic/gist:5047567
Unit Test select Join Zend\Db
assume, i have a method in AlbumTable class like the following :
<?php
/////////
public function fetchAll()
{
$sqlSelect = $this->tableGateway->getSql()
->select()->columns(array('artist', 'title', 'id'))
->join('track', 'track.album_id = album.id', array(), 'left');
return $this->tableGateway->select($sqlSelect);