Wraps an object in {@see ObjectWrapper}.

@see ObjectWrapper
@param object $object
@param string $id If null, the object's class name will be used
@param int $ttl
@return ObjectWrapper
323317
public function wrap($object, $id = null, $ttl = null)
    {
        $id = $id ?: get_class($object);
        return new ObjectWrapper($object, $this->ns($id, $ttl));
    }
654521
public function dequeue(AnObjectHandlable $object)
    {
        $this->getRepositoryEntities($object->getRepository())->extract($object);

        return parent::dequeue($object);
    }
929972
public function initialize($object)
    {
        foreach ($this->initializers as $interface => $initializer) {
            if ($object instanceof $interface) {
                $initializer($object, $this);
            }
        }

        if ($object instanceof ShutdownInterface) {
            $this->shutdownServices [] = $object;
        }

        return $object;
    }
1257091
public function set($key, $value, $ttl = null)
    {
        return $this->_instance->set($key, $value, $ttl);
    }
807652
public function offsetSet($offset, $object)
    {
        if (!$object instanceof ObjectHandlable) {
            throw new \InvalidArgumentException('Object needs to implement ObjectHandlable');
        }

        $this->__data[$object->getHandle()] = $object;
        return $this;
    }
1177519
public function persist($object, $collection = null)
    {
        $repository = $this->getRepository(get_class($object), $collection);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_PRE_PERSIST, $object);
        $this->addObject($object, ObjectManager::OBJ_NEW, $repository);
        $repository->getClassMetadata()->getEventManager()->execute(EventManager::EVENT_POST_PERSIST, $object);

        return $this;
    }
139738
public function prepareObject($object)
    {
        $tokenList = $this->getMethodTokenList();

        for ($i = 0, $c = count($tokenList); $i < $c; $i++) {
            if ($this->reflection->hasMethod(self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']))) {
                $m = self::SETTER_PREFIX . ucfirst($tokenList[$i]['property']);
                if ($tokenList[$i]['type'] == RouteMethodAnnotaionParser::TYPE_CLASS) {
                    $value = new $tokenList[$i]['value']();
                } else {
                    $value = $tokenList[$i]['value'];
                }
                $object->$m($value);
            }
        }

        return $object;
    }
183621
protected function instantiateRowWrapperObject($row)
    {
        if ($this->row_wrapper_class === null) {
            $object = $row;
        } else {
            $object = new $this->row_wrapper_class(
                $row,
                $this->getOption('read_only')
            );
        }

        return $object;
    }
787256
public function save( $id, $data, $ttl = 0 ) {
		$this->cache->save( $id, $data, $ttl );
	}
856852
public function set($key, $value, $ttl = null)
    {
        return $this->driver->set($key, serialize($value), $ttl);
    }
773075
public void registerObject(final Object object, final UUID id) {
        objectToId.put(object, id);
        idToObject.put(id, object);
    }
474221
public static function get_for_object($object)
    {
        // Capture changesetitem for both changed and deleted objects
        $id = $object->isInDB()
            ? $object->ID
            : $object->OldID;
        return static::get_for_object_by_id($id, $object->baseClass());
    }
312630
public function translate($object)
    {
        $commandBaseNamespace = app()->getNamespace() . "Commands";
        $handlerBaseNamespace = app()->getNamespace(). "Handlers";

        $reflectionObject = new ReflectionClass($object);

        $commandNamespace = $this->getCommandNamespace($commandBaseNamespace, $reflectionObject);
        $command = $this->getCommandName($reflectionObject);

        $handler = str_replace('Command', 'CommandHandler', $command);


        if($commandNamespace !== $commandBaseNamespace) {
            $handlerNamespace = $handlerBaseNamespace . $commandNamespace . "\\" . $handler;

            $commandNamespace = $commandBaseNamespace .  $commandNamespace . "\\" . $command;
        }


        if(! class_exists($commandNamespace)) {
            throw new CommandNotFoundException("Command [ $command ] does not exist.");
        }

        if(! class_exists($handlerNamespace)) {
            throw new HandlerNotFoundException("Handler [ $handler ] does nto exist.");
        }

        return $handlerNamespace;
    }
1168694
public function extract(AnObjectHandlable $object)
    {
        $handle = $object->getHandle();

        if ($this->_object_set->offsetExists($handle)) {
            $this->_object_set->offsetUnset($handle);
        }

        return $this;
    }
317931
public function wrap($event, $object, $callback)
    {
        $events = (array) $event;

        foreach($events as $e)
            $this->trigger("before{$e}", $object);

        call_user_func($callback, $object);

        foreach($events as $e)
            $this->trigger("after{$e}", $object);

        return $this;
    }
444824
public function withInitialValuesFrom($object) : FormWithBinding
    {
        $form = $this->binding->getForm($object);

        return new self(
            $form->getSections(),
            $form->getProcessors(),
            $this->binding->getObjectType(),
            $this->binding->getFieldBindings()
        );
    }
424608
public function createExists($id, $value, $ttl = null)
    {
        return $this->create($id, $value, $ttl, true);
    }