Example #1
0
 /**
  * Return entity instance.
  *
  * @param $id
  * @return null|Cmd
  */
 private function findEntity($id)
 {
     $collection = $this->context->getCmdCollection();
     if (!$collection->has($id)) {
         $this->context->getLogger()->debug('Cmd instance for ID: ' . $id . ' not found. Perform initialization.');
         $cmd = new Cmd();
         $collection->set($id, $cmd);
     }
     return $collection->get($id);
 }
Example #2
0
<?php

require __DIR__ . '/vendor/autoload.php';
use PhpCluster\Application;
$app = new Application($argv);
$app->run();