Creates an object by the pointer

@param mixed $pointer
@return object
@throws \axy\creator\errors\InvalidPointer
339720
public function create($pointer)
    {
        $pointer = PointerFormat::normalize($pointer, $this->context);
        $instance = Builder::build($pointer, $this->context);
        Validator::validate($instance, $this->context);
        return $instance;
    }
1370147
public static function create($parameters)
    {
        if (is_string($parameters)) {
            return self::fromString($parameters);
        }

        if (is_array($parameters)) {
            return self::fromArray($parameters);
        }

        throw new InvalidArgumentException('Invalid parameters type');
    }
797254
public static function fromObject( $object, $rootName = null, $nodeName = null, $addHeader = true )
    {
        if ( !is_object( $object ) )
        {
            throw new \InvalidArgumentException( 'The value of "$object" is not an object.' );
        }

        return static::fromArray( get_object_vars( $object ), $rootName, $nodeName, $addHeader );
    }
1215489
static function create( $attributeId, $version, $latitude = 0.0, $longitude = 0.0, $address = ''  )
    {
        $object = new self( array( 'contentobject_attribute_id' => $attributeId,
                                   'contentobject_version' => $version,
                                   'latitude' => $latitude,
                                   'longitude' => $longitude,
                                   'address' => $address
        ) );
        return $object;
    }
22465
public static function create($resource)
    {
        $type = gettype($resource);

        if ($type == 'string') {
            $stream = fopen('php://temp', 'r+');

            if ($resource !== '') {
                fwrite($stream, $resource);
                fseek($stream, 0);
            }

            return new self($stream);
        }

        if ($type == 'resource') {
            return new self($resource);
        }

        if ($resource instanceof StreamableInterface) {
            return $resource;
        }

        throw new \InvalidArgumentException('Invalid resource type: ' . $type);
    }
745867
public function getPointerPlugins($pointer)
    {
        $plugins = [];
        foreach ($this->getPointer($pointer, []) as $field) {
            $plugins[] = self::createField($field);
        }

        return $plugins;
    }
1256869
public function new()
    {
        if (isset($this->constructor)) {
            $constructor = $this->constructor;
            $arguments = func_get_args();
            $callback = array_pop($arguments);

            $input_count = isset($constructor['inputs']) ? count($constructor['inputs']) : 0;
            if (count($arguments) < $input_count) {
                throw new InvalidArgumentException('Please make sure you have put all constructor params and callback.');
            }
            if (is_callable($callback) !== true) {
                throw new \InvalidArgumentException('The last param must be callback function.');
            }
            if (!isset($this->bytecode)) {
                throw new \InvalidArgumentException('Please call bytecode($bytecode) before new().');
            }
            $params = array_splice($arguments, 0, $input_count);
            $data = $this->ethabi->encodeParameters($constructor, $params);
            $transaction = [];

            if (count($arguments) > 0) {
                $transaction = $arguments[0];
            }
            $transaction['data'] = '0x' . $this->bytecode . Utils::stripZero($data);

            $this->eth->sendTransaction($transaction, function ($err, $transaction) use ($callback){
                if ($err !== null) {
                    return call_user_func($callback, $err, null);
                }
                return call_user_func($callback, null, $transaction);
            });
        }
    }
470026
public static function build(array $pointer, array $context)
    {
        if (array_key_exists('value', $pointer)) {
            return $pointer['value'];
        }
        if (!empty($pointer['classname'])) {
            $classname = NameResolver::resolve($pointer['classname'], $context);
            return self::buildByClassname($classname, $pointer, $context);
        }
        if (!empty($pointer['creator'])) {
            return Callback::call($pointer['creator'], [$pointer, $context]);
        }
        if (!empty($context['classname'])) {
            return self::buildByClassname($context['classname'], $pointer, $context);
        }
        if (!empty($context['creator'])) {
            return Callback::call($context['creator'], [$pointer, $context]);
        }
        throw new InvalidPointer('');
    }
303013
public function make($data)
    {
        if ($data instanceof Collection) {
            $this->data = collect($data->toArray());
        } elseif (is_array($data)) {
            $this->data = collect($data);
        } else {
            throw new InvalidArgumentException('Invalid data type.');
        }

        $this->config = Config::get('nestable');

        $this->parent = $this->config['parent'];

        $this->primary_key = $this->config['primary_key'];

        return $this;
    }
1077408
public static function fromObject($object)
    {
        try {
            if (!\is_object($object)) {
                throw new UnexpectedTypeException($object, 'object');
            }

            if ($object instanceof SubjectIdentityInterface) {
                return $object;
            }
            if ($object instanceof SubjectInterface) {
                return new self(ClassUtils::getClass($object), (string) $object->getSubjectIdentifier(), $object);
            }
            if (method_exists($object, 'getId')) {
                return new self(ClassUtils::getClass($object), (string) $object->getId(), $object);
            }
        } catch (InvalidArgumentException $e) {
            throw new InvalidSubjectIdentityException($e->getMessage(), 0, $e);
        }

        throw new InvalidSubjectIdentityException('The object must either implement the SubjectInterface, or have a method named "getId"');
    }
5831
public function createNew($className)
    {
        $constructArguments = func_get_args();
        $object = $this->_createNew( ...$constructArguments);
        
        $traits = class_uses($object);

        if (isset($traits[Framework::class]) == true) {
            $object->setContainer($this->container);
        }

        return $object;
    }
158801
public function from($entityMapperTypeOrFactory)
    {
        if (is_callable($entityMapperTypeOrFactory)) {
            call_user_func($this->callback, $entityMapperTypeOrFactory);
        } elseif (is_a($entityMapperTypeOrFactory, IEntityMapper::class, true)) {
            call_user_func($this->callback, function (IOrm $orm) use ($entityMapperTypeOrFactory) {
                if ($this->iocContainer) {
                    return $this->iocContainer->bindForCallback(IOrm::class, $orm, function () use ($entityMapperTypeOrFactory) {
                        return  $this->iocContainer->get($entityMapperTypeOrFactory);
                    });
                }
                
                return new $entityMapperTypeOrFactory($orm);
            });
        } else {
            throw InvalidArgumentException::format(
                    'Invalid entity object factory: expecting callable or type of %s, %s given',
                    IEntityMapper::class, $entityMapperTypeOrFactory
            );
        }
    }
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;
    }
1269165
private function getAccessorForNode($node, $pointer, $currentPath)
    {
        try {
            $accessor = $this->factory->findAccessorForNode($node);
        } catch (NoMatchingAccessorException $exception) {
            throw new InvalidPathException(
                sprintf(
                    'The path %s in %s contains an not supported type: %s',
                    $currentPath,
                    is_array($pointer) ? implode('/', $pointer) : $pointer,
                    gettype($node)
                ),
                0,
                $exception
            );
        }

        return $accessor;
    }
318603
public static function create($object, $beforeCallable = null, $afterCallable = null, $bothCallable = null)
    {
        $wrapperObject = new Wrapper($object);
        if (is_callable($beforeCallable)) {
            $wrapperObject->registerOnBefore($beforeCallable);
        }

        if (is_callable($afterCallable)) {
            $wrapperObject->registerOnAfter($afterCallable);
        }

        if (is_callable($bothCallable)) {
            $wrapperObject->registerOnBoth($bothCallable);
        }

        return $wrapperObject;
    }
1100602
public function set($pointer, $data)
    {
        if ($pointer === '') {
            throw new \InvalidArgumentException('Cannot replace the object with set.');
        }

        $pointer = $this->parse($pointer);
        $replace = array_pop($pointer);
        $target  = &$this->getTarget($pointer);

        if (is_array($target)) {
            if ($replace === '-') {
                $target[] = $data;
            } else {
                $target[$replace] = $data;
            }
        } elseif (is_object($target)) {
            $target->$replace = $data;
        } else {
            throw InvalidPointerException::invalidTarget($target);
        }
    }
861308
public static function create($mapping): Mapping
    {
        if (\is_array($mapping)) {
            $mappingObject = new self();
            $mappingObject->setProperties($mapping);

            return $mappingObject;
        }

        if ($mapping instanceof self) {
            return $mapping;
        }

        throw new InvalidException('Invalid object type');
    }