Get from cache.

@param SettingsOwnerInterface $owner
@param string $name

@return mixed|null if nothing was found in cache
187633
protected function fetchFromCache($name, SettingsOwnerInterface $owner = null)
    {
        $cacheKey = $this->getCacheKey($name, $owner);

        return $this->storage->getItem($cacheKey)->get();
    }
863894
public function getSetting($name, $default = '')
    {

        if (array_key_exists($name, $this->settings)) {
            $value = $this->settings[$name];
        } else {
            $value = $default;
        }

        return $value;

    }
221969
public function getContext($name = null)
    {
        if (is_null($name)) {
            $name = $this->context;
        }

        return isset($this->contexts[$name]) ? $this->contexts[$name] : null;
    }
1321116
protected function _owner()
    {
        static $owner = false;

        if ( $owner === false )
        {
            $owner = eZUser::fetch( $this->owner_id );
        }

        return $owner;
    }
1085565
protected function retrieveUser($email, User $owner)
    {
        $user = $this->objectManager->getRepository('ClarolineCoreBundle:User')->findOneByEmail($email);

        if (null === $user) {
            $user = $owner;
        }

        return $user;
    }
907218
public function get( $name, $default = null )
	{
		$name = trim( $name, '/' );

		if( isset( $this->_negCache[ $name ] ) ) {
			return $default;
		}

		if( array_key_exists( $name, $this->_cache ) ) {
			return $this->_cache[ $name ];
		}

		if( ( $return = $this->_getValueFromArray( $this->_config, explode( '/', $name ) ) ) !== null ) {
			return $return;
		}

		$return = $this->_getObject()->get( $name, null );

		if( $return === null )
		{
			$this->_negCache[ $name ] = true;
			return $default;
		}

		$this->_cache[ $name ] = $return;
		return $return;
	}
1102976
private function getUserSettings(string $owner)
    {
        if (!$this->userSettings->get($owner)) {
            $this->userSettings->set($owner, $this->provider->findUserSettings($owner));
        }

        return $this->userSettings->get($owner);
    }
665229
public function get($name, $default = false)
    {
        $this->readTimes++;

        $result = $this->handler->get($this->getCacheKey($name));

        return false !== $result ? $this->unserialize($result) : $default;
    }
1176093
public function getStore( string $name = null ): CacheStoreInterface
	{
		if( is_null($name) )
		{
			$name = "default";
		}

		if( isset($this->store[$name]) || $this->loadStore($name) )
		{
			return $this->store[$name];
		}

		throw new NotFoundException("The '{$name}' cache store config not found");
	}
955341
public function findSettingItem($owner, $code)
    {
        if ($this->items === null) {
            $this->loadItems();
        }

        $owner = strtolower($owner);
        $code = strtolower($code);

        foreach ($this->items as $item) {
            if (strtolower($item->owner) == $owner && strtolower($item->code) == $code) {
                return $item;
            }
        }

        return false;
    }
184927
public function setOwner(\Haven\SecurityBundle\Entity\Role $owner = null) {
        $this->owner = $owner;

        return $this;
    }
156250
public static function getSetting( string $name, $defaultValue = null )
	{
		return self::isSettingSet($name)
			? self::$settings[$name]
			: $defaultValue;
	}
341952
public static function fromOwner( $owner, $provider, $dataPool )
	{
		$result = new ExprIterator();
		$result->nodes = $owner->toArray();
		$result->provider = $provider;
		$result->dataPool = $dataPool;
		return $result;
	}
228655
public function cacheGet($name) {
    /* Do cache garbage collection. */
    $this->cacheGc();

    try {
      $data = $this->store->read('cache', $this->cacheId($name));
    } catch (\phpSec\Exception $e) {
      return false;
    }
    if($data ==! false) {
      if($data['ttl'] > time()) {
        return unserialize($data['data']);
      }
      $this->store->delete('cache', $this->cacheId($name));
    }
    return false;
  }
1043648
public function setOwner(ContentInterface $owner = null)
    {
        if ($owner instanceof Content) {
            $this->content = $owner;
        } elseif ($owner instanceof Template) {
            $this->template = $owner;
        } elseif ($owner === null) {
            $this->template = null;
            $this->content = null;
        } else {
            throw new \Exception(sprintf('BlockInterface owner can only be of type Content or Template, not the provided %s type.', get_class($owner)));
        }

        return $this;
    }
209304
public static function fromOwnerAndName(string $owner, string $name): self
    {
        if (1 !== \preg_match(self::ownerRegEx(), $owner)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Owner "%s" does not appear to be a valid owner.',
                $owner
            ));
        }

        if (1 !== \preg_match(self::nameRegEx(), $name)) {
            throw new Exception\InvalidArgumentException(\sprintf(
                'Name "%s" does not appear to be a valid name.',
                $name
            ));
        }

        return new self(
            $owner,
            $name
        );
    }
1152647
private function getCacheKey($section, $key, ?string $owner = null)
    {
        return 'phpmob-settings.' . ($owner
                ? sprintf('%s.%s.%s', $section, $key, $owner)
                : sprintf('%s.%s', $section, $key)
            );
    }