Factory/AbstractCachedFactory.php
protected function get($objectName, $datas = null)
	{
		if(isset($this->bag[$objectName]))
		{
			return $this->bag[$objectName];
		}

		if($this->cacheDriver)
		{
			if(($cached = $this->cacheDriver->fetch($objectName . $this->cacheSalt)) !== false)
			{
				$this->bag[$objectName] = $cached;
			}
			else
			{
				$this->load($objectName, $datas);
				$this->cacheDriver->save(
						$objectName . $this->getCacheSalt(), $this->bag[$objectName]
				);
			}
		}
		else
		{
			$this->load($objectName, $datas);
		}

		return $this->bag[$objectName];
	}
protected function get($objectName, $datas = null)
	{
		if(isset($this->bag[$objectName]))
		{
			return $this->bag[$objectName];
		}

		if($this->cacheDriver)
		{
			if(($cached = $this->cacheDriver->fetch($objectName . $this->cacheSalt)) !== false)
			{
				$this->bag[$objectName] = $cached;
			}
			else
			{
				$this->load($objectName, $datas);
				$this->cacheDriver->save(
						$objectName . $this->getCacheSalt(), $this->bag[$objectName]
				);
			}
		}
		else
		{
			$this->load($objectName, $datas);
		}

		return $this->bag[$objectName];
	}
protected function get ( $ objectName , $ datas = null ) { if ( isset ( $ this -> bag [ $ objectName ] ) ) { return $ this -> bag [ $ objectName ] ; } if ( $ this -> cacheDriver ) { if ( ( $ cached = $ this -> cacheDriver -> fetch ( $ objectName . $ this -> cacheSalt ) ) !== false ) { $ this -> bag [ $ objectName ] = $ cached ; } else { $ this -> load ( $ objectName , $ datas ) ; $ this -> cacheDriver -> save ( $ objectName . $ this -> getCacheSalt ( ) , $ this -> bag [ $ objectName ] ) ; } } else { $ this -> load ( $ objectName , $ datas ) ; } return $ this -> bag [ $ objectName ] ; }
Call this method to get the object

@param string $objectName
@param mixed $datas
@return mixed
Call this method to get the object