Skip to content

Instantly share code, notes, and snippets.

public function getConfigFromDb()
{
if (!is_null($this->configInDb)) {
return $this->configInDb;
}
$sql = new Sql($this->getSlaveDbAdapter());
$select = $sql->select()
->from('languages');
<?php
abstract class AbstractCello
{
/**
* @var EventManager
*/
protected $em;
protected function triggerPre($methodName, $params)
@poisa
poisa / gist:6724548
Last active December 24, 2015 01:29
Generic method call using trigger()
<?php
public function findMemberById($id)
{
$params = $this->getEventManager()->prepareArgs(compact(func_get_args()));
$result = $this->getEventManager()->trigger(__FUNCTION__ . '.pre', $this, $params, function ($listenerOutput) {
return ($listenerOutput != null);
});
extract((array)$params);
require 'vendor/autoload.php';
use Aws\Sns\Validator\SnsValidator;
$incomingMessage = json_decode($HTTP_RAW_POST_DATA);
try {
// Case 1:
// Full auto pilot mode (this detects the strategy based on the 'Type' property of the incoming message