public function create ($exclude = array (), $cache = FALSE)
	{
		
		// If we're not caching or there is no memcached object just call parent
		
		if ($cache === FALSE || !($this->memcached instanceof \Memcached))
		{
			return parent::create ($exclude);
		}
		
		// Call parent method
		
		$parent	= parent::create ($exclude);
		
		if ($parent === FALSE)
		{
			return FALSE;
		}
		
		// Cache
		
		$this->memcached->set ($this->getMemcachedID (), $this->getCacheAttributes (), $cache);
		
		// Return
		
		return $parent;
		
	}
public function create ($exclude = array (), $cache = FALSE)
	{
		
		// If we're not caching or there is no memcached object just call parent
		
		if ($cache === FALSE || !($this->memcached instanceof \Memcached))
		{
			return parent::create ($exclude);
		}
		
		// Call parent method
		
		$parent	= parent::create ($exclude);
		
		if ($parent === FALSE)
		{
			return FALSE;
		}
		
		// Cache
		
		$this->memcached->set ($this->getMemcachedID (), $this->getCacheAttributes (), $cache);
		
		// Return
		
		return $parent;
		
	}
public function create ( $ exclude = array ( ) , $ cache = FALSE ) { // If we're not caching or there is no memcached object just call parent if ( $ cache === FALSE || ! ( $ this -> memcached instanceof \ Memcached ) ) { return parent :: create ( $ exclude ) ; } // Call parent method $ parent = parent :: create ( $ exclude ) ; if ( $ parent === FALSE ) { return FALSE ; } // Cache $ this -> memcached -> set ( $ this -> getMemcachedID ( ) , $ this -> getCacheAttributes ( ) , $ cache ) ; // Return return $ parent ; }
Create object in the database and set in memcached
@param array $exclude Attributes not to set
@param integer|boolean $cache Number of seconds to cache the object for
0 = cache never expires, FALSE = do not cache
@return boolean
Create object in the database and set in memcached