/** * emailValidator * * @return object */ public function emailValidator() { if (is_null($this->emailValidator)) { $this->emailValidator = Gongo_Locator::get('Gongo_Str_Email'); } return $this->emailValidator; }
static function getInstance() { if (is_null(self::$singleton)) { self::$singleton = Gongo_Locator::get('Gongo_Str_Base'); } return self::$singleton; }
static function get($path = null) { if (is_null(self::$log)) { $path = is_null($path) ? 'log.txt' : $path; self::$log = Gongo_Locator::get('Gongo_Log', $path); } return self::$log; }
static function get($cfg = null) { if (is_null(self::$config)) { $cfg = is_null($cfg) ? dirname(__FILE__) . '/config.ini' : $cfg; self::$config = Gongo_Locator::get('Gongo_Config', $cfg); } return self::$config; }
public function __get($key) { if ($key === '_') { if (is_null($this->__)) { return null; } $aComponents = $this->___initializeComponents(); return $this->_ = Gongo_Locator::get('Gongo_Container', $aComponents); } return null; }
public function filter($app, $src = null, $dst = null, $cast = false, $strict = false, $unset = true) { $filters = empty($this->options->filter) ? null : $this->options->filter; $src = is_null($src) ? $app->post : $src; $src = is_array($src) ? Gongo_Locator::get($this->options->defaultEntityClass, $src) : $src; $dst = is_null($dst) ? $src : $dst; $dst = is_array($dst) ? Gongo_Locator::get($this->options->defaultEntityClass, $dst) : $dst; if ($this->__filter) { return $this->filter->convert($src, $dst, $filters, $cast, $strict, $unset); } return $this->converter->convert($src, $dst, $filters, $cast, $strict, $unset); }
public function parse() { return Gongo_Locator::get('Gongo_Bean', parse_ini_file($this->path, true)); }
function getRelationMapperInstance($class) { return Gongo_Locator::get($class, $this->db()); }
function pages($args = array(), $hash = null, $short = true) { $range = $this->options->range; $last = $this->lastPage(); $first = $this->firstPage(); $page = $this->currentPage(); $left = max($page - $range, $first); $right = min($page + $range, $last); if ($page <= $range) { $extend = $range - ($page - $left); $right = min($page + $range + $extend, $last); } else { if ($page + $range > $last) { $extend = $range - ($last - $page); $left = max($page - $range - $extend, $first); } } $pages = array(); if ($last <= $first) { return $pages; } for ($i = $left; $i <= $right; $i++) { $bean = Gongo_Locator::get('Gongo_Bean'); $bean->no = $i + 1; $bean->url = $this->buildUrl($i, $args, $hash, $short); $bean->current = $i == $page; $pages[$i] = $bean; } return $pages; }
function _twig() { return Gongo_Locator::get('Gongo_App_Path_Twig', $this); }
public function ___($ary = array()) { $className = get_class($this); return Gongo_Locator::get($className, $ary); }
static function iter($path) { return Sloth::iter(Gongo_Locator::get('DirectoryIterator', $path)); }
function newBuilder() { return Gongo_Locator::get($this->defaultBuilder)->namedScopes($this->namedScopes()); }
function __get($name) { $className = $this->className($name); return Gongo_Locator::get($className, $this); }
public function initPath() { return Gongo_Locator::get('Gongo_App_Path_Mustache', Gongo_App::$environment->path, $this->templateType); }
static function property($obj) { return Gongo_Locator::get('Gongo_Fn_Property', $obj); }
public function __call($sName, $aArgs) { if (isset($this->_clause[$sName])) { return call_user_func(array($this, $this->_clause[$sName][1]), $this->_clause[$sName][0], $aArgs); } if (isset($this->_namedScopes[$sName])) { $this->setQuery($this->_namedScopes[$sName]); $methodName = isset($this->_query['method']) ? $this->_query['method'] : $this->_defaultMethod; $methodName = is_array($methodName) ? $methodName[0] : $methodName; return call_user_func_array(array($this, $methodName), $aArgs); } if ($sName[0] === '_') { $sName = substr($sName, 1); if (isset($this->_namedScopes[$sName])) { $query = $this->_namedScopes[$sName]; $params = isset($query['params']) ? $query['params'] : null; return call_user_func(array($this->setQuery($this->_namedScopes[$sName]), '___bindParams'), $aArgs, $params); } } throw Gongo_Locator::get('Gongo_Db_GoQlException', "{$sName} was not found in GoQL method."); }
function _pdoBuilder() { return Gongo_Locator::get('Gongo_App_DB_PDO_Builder'); }