Returns a DataTransferObject for the given object name.

@param mixed $object
@return \Netlogix\Crud\Domain\Model\DataTransfer\AbstractDataTransferObject
321356
public function getDataTransferObject($object) {
		if ($object === NULL) {
			return NULL;
		}
		$identifier = $this->persistenceManager->getIdentifierByObject($object);
		$dto = $this->propertyMapper->convert($identifier, $this->getDataTransferObjectName($object));
		return $dto;
	}
581394
public static function transform($object, $request = null)
	{
		return Transformations::transform($object, $request ?: Request::instance());
	}
407224
public function toItem($object): ? Item
    {
        foreach ($this->writeTransformers as $writeTransformer) {
            if ($writeTransformer->isValidObject($object)) {
                $item = $writeTransformer->toItem($object);
                $this
                    ->eventDispatcher
                    ->dispatch(
                        'apisearch.item_transformed',
                        new ItemTransformed(
                            $item,
                            $object
                        )
                    );

                return $item;
            }
        }

        return null;
    }
934640
public function objectToArray($object)
    {
        if (!is_object($object) && !is_array($object)) {
            return $object;
        }
        if (is_object($object)) {
            $object = get_object_vars($object);
        }

        return array_map([get_class(), 'objectToArray'], $object);
    }
284828
public static function toObject( $object )
    {
        //	If we can't iterate over the thing, we bail
        if ( !is_object( $object ) && !is_array( $object ) && !( $object instanceof \Traversable ) )
        {
            return null;
        }

        if ( is_array( $object ) )
        {
            //	Convert to an object
            $_properties = new \stdClass();

            foreach ( $object as $_key => $_value )
            {
                $_properties->{$_key} = $_value;
            }
        }
        else
        {
            $_me = new \ReflectionObject( $object );
            $_properties = $_me->getProperties();
        }

        //	We'll return this
        $_obj = new \stdClass();

        if ( !empty( $_properties ) )
        {
            if ( is_object( $object ) )
            {
                $_myClass = get_class( $object );
            }
            else
            {
                $_myClass = '_array_';
            }

            foreach ( $_properties as $_property )
            {
                //	Only want properties of $object hierarchy...
                if ( isset( $_property->class ) )
                {
                    $_class = new \ReflectionClass( $_property->class );

                    if ( !empty( $_class ) && !$_class->isInstance( $object ) && !$_class->isSubclassOf( $_myClass ) )
                    {
                        unset( $_class );
                        continue;
                    }

                    unset( $_class );
                }

                try
                {
                    $_realPropertyName = $_propertyName = ltrim( $_property->name, '_ ' );

                    if ( false !== strpos( $_propertyName, '_' ) )
                    {
                        $_propertyName = Inflector::tag( $_propertyName );
                    }

                    $_getter = 'get' . $_propertyName;

                    if ( method_exists( $object, $_getter ) )
                    {
                        $_propertyValue = $object->{$_getter}();

                        if ( !is_scalar( $_propertyValue ) )
                        {
                            $_propertyValue = self::toObject( $_propertyValue );
                        }

                        $_obj->{$_realPropertyName} = $_propertyValue;
                    }
                }
                catch ( \Exception $_ex )
                {
                    //	Just ignore, not a valid property if we can't read it with a getter
                }
            }
        }

        return $_obj;
    }
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);
    }
581303
public static function get($object) {
        /** @var \Gcs\Framework\Core\Http\Request\Form $class */
        $class = $object->name;
        $class = new $class();
        $class->init();

        $request = Request::instance();

        if (($class->getForm() == '' && $request->data->form == true) || isset($request->data->post[$class->getForm()])) {
            switch ($request->data->method) {
                case 'get' :
                    $class->get();
                    break;

                case 'post' :
                    $class->post();
                    break;

                case 'put' :
                    $class->put();
                    break;

                case 'patch' :
                    $class->patch();
                    break;

                case 'delete' :
                    $class->delete();
                    break;
            }

            $class->check();
        }

        return $class;
    }
1110283
public function extract($object)
    {
        $data = parent::extract($object);

        foreach ($this->getFreeValuesKeys() as $key) {
            $data[$key] = $object->get($key);
        }

        return $data;
    }
906918
protected static function createFromObjectForAdditional($object)
    {
        $indexProperty = null;
        $class = null;

        if (property_exists($object, 'anyOf')) {
            $indexProperty = 'anyOf';
            $class = AnyOf::class;
        } elseif (property_exists($object, 'allOf')) {
            $indexProperty = 'allOf';
            $class = AllOf::class;
        } elseif (property_exists($object, 'oneOf')) {
            $indexProperty = 'oneOf';
            $class = OneOf::class;
        } else {
            return null;
        }

        //Parse index property's object as validator
        foreach ($object->{$indexProperty} as &$property) {
            $property = BaseValidator::createFromObject($property);
        }

        $validator = new $class($object->{$indexProperty});

        return $validator;
    }
618739
public function populateDefaultRelations(DataObject $object)
    {
        foreach ($object->hasOne() as $name => $class) {
            
            if ($id = $this->getDefaultRelation($class)) {
                $object->{$name . 'ID'} = $id;
            }
            
        }
        
        return $object;
    }
1301738
public static function get($object) {
        $class = $object->name;

        /** @var \Gcs\Framework\Core\Orm\Entity\Entity $class */
        $class = new $class();

        $request = Request::instance();

        if (($class->getForm() == '' && $request->data->form == true) || isset($request->data->post[$class->getForm()])) {
            switch ($request->data->method) {
                case 'get' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeInsert();
                    break;

                case 'post' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeInsert();
                    break;

                case 'put' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeUpdate();
                    break;

                case 'patch' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforePatch();
                    break;

                case 'delete' :
                    $class->hydrate(strtolower($class->name()) . '_');
                    $class->beforeDelete();
                    break;
            }

            $class->check();
        }

        return $class;
    }
1214617
protected function transformOutput($object, array $context = [])
    {
        $outputClass = $this->getOutputClass($this->getObjectClass($object), $context);
        if (null !== $outputClass && null !== $dataTransformer = $this->getDataTransformer($object, $outputClass, $context)) {
            return $dataTransformer->transform($object, $outputClass, $context);
        }

        return $object;
    }
207618
public function extract($object)
    {
        $data = ['name' => $object->getNormalizedName()];
        if ($object->hasParent()) {
            $data['source'] = strval($object->getParent()->getNormalizedName());
        }
        return $data;
    }
914699
private function innerSerialize($object)
    {
        if (is_array($object)) {
            $serializedArray = [];
            foreach ($object as $key => $value) {
                $serializedArray[$key] = $this->innerSerialize($value);
            }

            return $serializedArray;
        } elseif (is_object($object)) {
            return $this->serializeObject($object);
        } else {
            return $object;
        }
    }
777804
public static function instance($object)
    {
        if (!is_object($object)) {
            throw new \InvalidArgumentException('Only objects are allowed to be passed to the helper.');
        }

        $response = new self();
        $response->origin = $object;
        $response->target = new ReflectionClass($object);
        return $response;
    }
511339
protected function hydrateObjectForm($object)
    {
        $data = array(
            "id" => $object->getId(),
            "visible" => (bool) $object->getVisible(),
            "code" => $object->getCode(),
            "title" => $object->getTitle(),
            "type" => $object->getType(),
            "entity" => $object->getEntity(),
            "serialized_columns" => $object->getSerializedColumns(),
            "serialized_condition" => $object->getSerializedCondition(),
            "index_engine_driver_configuration_id" => $object->getIndexEngineDriverConfigurationId(),
        );

        return $this->getUpdateForm($data);
    }
1372398
public function get($object)
	{
		if ($this->oauth != null)
		{
			if ($this->oauth->isAuthenticated())
			{
				$response = $this->oauth->query($this->fetchUrl($object));

				return json_decode($response->body);
			}
			else
			{
				return false;
			}
		}

		// Send the request.
		return $this->sendRequest($object);
	}