@param object $object

@return \Spryker\Install\Timer\TimerInterface
177555
public function start($object): TimerInterface
    {
        $this->timer[spl_object_hash($object)] = microtime(true);

        return $this;
    }
1034428
public function dispatch($object)
    {
        $handler = $this->commandTranslator->translate($object);

        return $this->app->make($handler)->handle($object);
    }
941148
public function getParameterClassObject($object, $method)
    {
        $reflectionClass = new \ReflectionClass(get_class($object));
        $parameters = $reflectionClass->getMethod($method)->getParameters();

        if ($parameters && isset($parameters[0])) {
            $refClass = $parameters[0]->getClass();

            if ($refClass) {
                $class = $refClass->getName();

                return new $class();
            }
        }
    }
960968
public static function from($object): self
    {
        if ($object instanceof self) {
            return $object;
        }

        if (\is_object($object)) {
            $object = \get_class($object);
        }

        if (! \is_string($object)) {
            throw new InvalidArgumentException('Cannot create a type from '.\gettype($object));
        }

        return new self($object);
    }
986558
protected function normalize($object)
    {
        // If its a paginator instance, create a collection with its items.
        if ($object instanceof Paginator) {
            return collect($object->items());
        } elseif (is_array($object)) {
            // If its an array, package it in a collection.
            return collect($object);
        }

        return $object;
    }
1274588
public function schedule(TimerInterface $timer)
    {

        // force handling the timer tasks now
        $this->synchronized(function (TimerInterface $t) {

            // store the timer-ID and the PK of the timer service => necessary to load the timer later
            $this->scheduledTimers[$timerId = $t->getId()] = $t->getTimerService()->getPrimaryKey();

            // create a wrapper instance for the timer task that we want to schedule
            $timerTaskWrapper = new \stdClass();
            $timerTaskWrapper->executeAt = microtime(true) + ($t->getTimeRemaining() / 1000000);
            $timerTaskWrapper->taskId = uniqid();
            $timerTaskWrapper->timerId = $timerId;

            // schedule the timer tasks as wrapper
            $this->tasksToExecute[$timerTaskWrapper->taskId] = $timerTaskWrapper;

        }, $timer);
    }
823362
public function setByObject(stdClass $object)
    {
        $vars = get_object_vars($object);

        if (is_array($vars)) {
            foreach ($vars as $property => $value) {
                $this->$property = $value;
            }
        }

        return $this;
    }
1055608
private function doCreateProxy($object)
    {
        $proxy = $this->factory->createProxy($object);
        /* $this in closures does not work with PHP 5.3
         * so we have to pass the object explicitely
         * with its private properties */
        $_this = $this;
        $securityContext = $this->services['security.context'];

        foreach($this->protected_classes[ClassUtils::getRealClass($object)]['methods'] as $method => $options) {
            $attribute = isset($options['attribute']) ? $options['attribute'] : false;
            $expression = isset($options['expression']) ? $options['expression'] : false;
            $returnProxy = isset($options['return_proxy']) ? $options['return_proxy'] : false;
            $denyValue = isset($options['deny_value']) ? $options['deny_value'] : null;

            if($attribute != false && $expression != false) {
                $proxy->setMethodPrefixInterceptor($method,
                    function($proxy, $instance, $methodName, $params, & $returnEarly) use ($expression, $attribute, $denyValue, $securityContext)
                    {
                        if (!($securityContext->isGranted(new Expression($expression), $instance) && $securityContext->isGranted($attribute, $instance)))  {
                            $returnEarly = true;
                            return $denyValue;
                        } else {
                            $returnEarly = false;
                            return;
                        }
                    }
                );
                continue;
            }

            if($attribute != false) {
                $proxy->setMethodPrefixInterceptor($method,
                    function($proxy, $instance, $methodName, $params, & $returnEarly) use ($attribute, $denyValue, $securityContext)
                    {
                        if (!$securityContext->isGranted($attribute, $instance)) {
                            $returnEarly = true;
                            return $denyValue;
                        } else {
                            $returnEarly = false;
                            return;
                        }
                    }
                );
                continue;
            }

            if($expression != false) {
                $proxy->setMethodPrefixInterceptor($method,
                    function($proxy, $instance, $methodName, $params, & $returnEarly) use ($expression, $denyValue, $securityContext)
                    {
                        if (!$securityContext->isGranted(new Expression($expression), $instance)) {
                            $returnEarly = true;
                            return $denyValue;
                        } else {
                            $returnEarly = false;
                            return;
                        }
                    }
                );
            }

            if($returnProxy) {
                $proxy->setMethodSuffixInterceptor($method,
                    function ($proxy, $instance, $methodName, $params, $returnValue, & $returnEarly) use ($_this)
                    {
                        if(is_object($returnValue) && $returnValue === $proxy) {
                            $returnEarly = false;
                            return;
                        } else if ($_this->isProtected($returnValue)) {
                            $returnEarly = true;
                            return $_this->getProxy($returnValue);
                        } else if (is_array($returnValue)
                            || $returnValue instanceof \Traversable
                            || $returnValue instanceof \ArrayAccess
                        ) {
                            $return = array();
                            foreach($returnValue as $element) {
                                if($_this->isProtected($element)) {
                                    $return[] = $_this->getProxy($element);
                                } else {
                                    $return[] = $element;
                                }
                            }
                            $returnEarly = true;
                            return $return;
                        }
                    }
                );
            }
        } // end foreach

        return $proxy;
    }
731061
public static function create($object)
    {
        if ($object instanceof JobDetail) {
            $message = sprintf(
                'Unable to store Job : "%s", because one already exists with this identification.', $object->getKey()
            );
        } elseif ($object instanceof Trigger) {
            $message = sprintf(
                'Unable to store Trigger with name: "%s" and group: "%s", because one already exists with this identification.'
                , $object->getKey()->getName(), $object->getKey()->getGroup()
            );
        } else {
            $message = (string) $object;
        }

        return new static($message);
    }
383334
private function getReflection($object)
    {
        $key = get_class($object);

        if (!array_key_exists($key, $this->buffer)) {
            $this->buffer[$key] = new \ReflectionClass($object);
        }

        return $this->buffer[$key];
    }
1341169
protected function injectObjectDependencies($object)
    {
        if (count($this->injectors)) {
            $class = get_class($object);
            foreach ($this->injectors as $interface => $injector) {
                $this->trace(
                    'Call injector for "{class}" for support interface "{interface}".',
                    [
                        'class' => $class,
                        'interface' => $interface
                    ]
                );
                call_user_func($injector, $object, $this->getToolkit());
            }
        }
    }
1286404
public static function createFromObject($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('Object was expected.');
        }

        $className = get_class($object);

        return new self($className);
    }
325766
public function make($object)
    {
        $manager = Manager::getInstance();

        // Instantiate hydrator
        // TODO: We'll need to optimize this and allow pre-generation
        //       of these hydrators, and get it, ideally, from the entityMap or
        //       the Mapper class, so it's only instantiated once
        $config = new Configuration(get_class($object));

        $hydratorClass = $config->createFactory()->getHydratorClass();
        $hydrator = new $hydratorClass();

        if ($manager->isValueObject($object)) {
            $entityMap = $manager->getValueMap($object);
        } else {
            $entityMap = $manager->mapper($object)->getEntityMap();
        }

        // Build Wrapper
        return new ObjectWrapper($object, $entityMap, $hydrator);
    }
985620
public function delete($object)
    {
        $ret = $this->getValidator()->validateDelete($object);
        if ($ret) {
            $ret = $this->_delete($object);
        }
        return $ret;
    }
1314635
protected static function safeCreateDateTimeZone($object)
    {
        if ($object === null) {
            return new DateTimeZone(date_default_timezone_get());
        }

        if ($object instanceof DateTimeZone) {
            return $object;
        }

        return new DateTimeZone($object);
    }
392987
protected function createObject($object)
    {
        $type = new ObjectType(['class'=>get_class($object)]);

        foreach (get_object_vars($object) as $property=>$value) {
            $type[$property] = $this->toType($value);
        }

        return $type;
    }
298869
private function getClass($object): string
    {
        if (interface_exists('Doctrine\Common\Persistence\Proxy') && $object instanceof Proxy) {
            if (!$object->__isInitialized()) {
                $object->__load();
            }

            return (new \ReflectionClass($object))->getParentClass()->name;
        }

        return get_class($object);
    }