Stash\Pool::setNamespace PHP Method

setNamespace() public method

public setNamespace ( $namespace = null )
    public function setNamespace($namespace = null)
    {
        if (is_null($namespace)) {
            $this->namespace = null;
            return true;
        }
        if (!ctype_alnum($namespace)) {
            throw new \InvalidArgumentException('Namespace must be alphanumeric.');
        }
        $this->namespace = $namespace;
        return true;
    }

Usage Example

Example #1
0
 public function __construct()
 {
     $this->pool = new Pool(new Memcache([['127.0.0.1', '11211']]));
     $this->pool->setNamespace('hotflo20dev');
 }
All Usage Examples Of Stash\Pool::setNamespace