private function getLog($logPath, $hash) { $finder = $this->finderFactory->create()->files()->in($logPath)->name("{$hash}.log"); foreach ($finder as $file) { return $file; } }
public static function factory() { if (self::$_sharedFactory == null) { self::$_sharedFactory = new FinderFactory(); } return self::$_sharedFactory; }
public function getAll($coreModelName) { $finder = FinderFactory::factory()->createObject($coreModelName); if ($finder == NULL) { return false; } return $finder->findAll(); }
public function getEntityById($type, $id) { $finder = FinderFactory::createFinderWithType($type); if ($finder === null) { throw Exception('Invalid type'); } $object = $finder->findById($id); return $object; }
public function actionResources() { $resourceFinder = FinderFactory::createFinderWithType('resource'); if (is_null($resourceFinder)) { die('Error: invalid finder'); } $resourceFinder->setType('image'); $audioResources = $resourceFinder->findAll(); if (is_null($audioResources) || !isset($audioResources)) { $audioResources = array(); } $this->render('resources', array('data' => $audioResources)); }
protected function _getFinder() { include_once(LIMB_DIR . '/class/core/finders/FinderFactory.class.php'); return FinderFactory :: create('site_objects_raw_finder'); }
<?php namespace App; require_once __DIR__ . '/Helpers/Uri.php'; require_once __DIR__ . "/FinderFactory.php"; // generate app uri $uri = new \Helpers\Uri(); $appUri = $uri->getAppUri(); // construct a new factory $finderFactory = new FinderFactory(); $finder = $finderFactory->getFinder($appUri); // call the specific function based on query string input if (isset($_GET['f'])) { #eg: area/arealist $finder->find($_GET['f']); } else { // default return $data = ["status" => 500, "message" => "Invalid Request"]; header('Content-Type: application/json'); echo json_encode($data); }
protected function _getFinder() { if ($this->finder) return $this->finder; include_once(LIMB_DIR . '/class/core/finders/FinderFactory.class.php'); $this->finder = FinderFactory :: create($this->finder_name); return $this->finder; }
protected function _getFinder() { include_once(LIMB_DIR . '/class/core/finders/FinderFactory.class.php'); return FinderFactory :: create('OneTableObjectsRawFinder'); }
public function actionViewResourceObject($id, $type, $type_id) { $finder = FinderFactory::createFinderWithType('class'); $class = $finder->findById(intval($type_id)); $finder = FinderFactory::createFinderWithType('resource'); $finder->setType($type); $resource = $finder->findById(intval($id)); $finder = FinderFactory::createFinderWithType('object'); $objects = $finder->findAll(); $this->render('resourceview', array('type' => $type, 'class' => $class, 'resource' => $resource, 'objects' => $objects)); }