Serialized \Google\Protobuf\Compiler\CodeGeneratorRequest to Protocol Buffers message.

@param CodeGeneratorRequest $object
@param array $filter

@throws \Exception

@return string
325041
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->fileToGenerate) && ($filter === null || isset($filter['fileToGenerate']))) {
			foreach ($object->fileToGenerate instanceof \Traversable ? $object->fileToGenerate : (array)$object->fileToGenerate as $k => $v) {
				$output .= "\x0a";
				$output .= Binary::encodeVarint(strlen($v));
				$output .= $v;
			}
		}

		if (isset($object->parameter) && ($filter === null || isset($filter['parameter']))) {
			$output .= "\x12";
			$output .= Binary::encodeVarint(strlen($object->parameter));
			$output .= $object->parameter;
		}

		if (isset($object->protoFile) && ($filter === null || isset($filter['protoFile']))) {
			foreach ($object->protoFile instanceof \Traversable ? $object->protoFile : (array)$object->protoFile as $k => $v) {
				$output .= "\x7a";
				$buffer = FileDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['protoFile']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		return $output;
	}
506883
public function getAll($classname, $filter = null, AbstractModel $parent = null)
    {
        $filterUrl = '';
        if (!is_null($filter)) {
            if (
                isset($this->filters[$classname]) &&
                in_array($filter, $this->filters[$classname])) {

                $filterUrl = '/filter/' . $filter;
            } elseif (
                isset($this->filters[$classname]) &&
                preg_match('/^[0-9]+$/D', $filter)) {

                $filterUrl = '/filter/' . $filter;
            } else {
                $message = 'Unknown filter "' . $filter . '" for ' . $classname;
                if (isset($this->filters[$classname])) {
                    $message .= '; available filters: ' . implode(', ', $this->filters[$classname]);
                }
                throw new InvalidFilterException($message);
            }
        }

        $response = $this->request($this->buildUrl(new $classname(), $parent, $filterUrl), 'GET');
        return $this->mapper->mapFromStorage($response);
    }
231414
public static function transform($object, $request)
	{
		$transformer = static::getTransformer($object);
		if (!$transformer) {
			return $object;
		}
		
		return $transformer->transform($object, $request);
	}
800690
public static function createAdapterObject($object)
    {
        $wrapperObject = self::create($object, null, function ($method, $arguments, $result) {
            $data['method']    = $method;
            $data['arguments'] = $arguments;

            $appType = php_sapi_name();
            if ($appType == 'cli') {
                $processName = @cli_get_process_title();
                if (strpos($processName, 'msf') !== false) {
                    $appType = 'msf';
                }
            } else {
                $appType = 'web';
            }

            if ($appType != 'msf' && $result instanceof \Generator) {
                $data['result'] = $result->getReturn();
                return $data;
            }

            $data['result'] = $result;
            return $data;
        });

        return $wrapperObject;
    }
480651
public static function reset($object)
	{
		if (!($object instanceof CodeGeneratorRequest)) {
			throw new \InvalidArgumentException('You have to pass object of class Google\Protobuf\Compiler\CodeGeneratorRequest.');
		}
		$object->fileToGenerate = NULL;
		$object->parameter = NULL;
		$object->protoFile = NULL;
	}
243870
public static function decodeFilter($filter, $data) {
		switch ($filter) {
			case 'ASCIIHexDecode': {
				return self::decodeFilterASCIIHexDecode($data);
				break;
			}
			case 'ASCII85Decode': {
				return self::decodeFilterASCII85Decode($data);
				break;
			}
			case 'LZWDecode': {
				return self::decodeFilterLZWDecode($data);
				break;
			}
			case 'FlateDecode': {
				return self::decodeFilterFlateDecode($data);
				break;
			}
			case 'RunLengthDecode': {
				return self::decodeFilterRunLengthDecode($data);
				break;
			}
			case 'CCITTFaxDecode': {
				return self::decodeFilterCCITTFaxDecode($data);
				break;
			}
			case 'JBIG2Decode': {
				return self::decodeFilterJBIG2Decode($data);
				break;
			}
			case 'DCTDecode': {
				return self::decodeFilterDCTDecode($data);
				break;
			}
			case 'JPXDecode': {
				return self::decodeFilterJPXDecode($data);
				break;
			}
			case 'Crypt': {
				return self::decodeFilterCrypt($data);
				break;
			}
			default: {
				return self::decodeFilterStandard($data);
				break;
			}
		}
	}
146586
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->namePart) && ($filter === null || isset($filter['namePart']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->namePart));
			$output .= $object->namePart;
		}

		if (isset($object->isExtension) && ($filter === null || isset($filter['isExtension']))) {
			$output .= "\x10";
			$output .= Binary::encodeVarint((int)$object->isExtension);
		}

		return $output;
	}
1265901
private function encodeObject($object, array $options, callable $encode)
    {
        if ($options['object.format'] === 'string') {
            return $encode((string) $object);
        } elseif ($options['object.format'] === 'serialize') {
            return sprintf('unserialize(%s)', $encode(serialize($object)));
        } elseif ($options['object.format'] === 'export') {
            return sprintf('\\%s::__set_state(%s)', \get_class($object), $encode($this->getObjectState($object)));
        }

        return $this->encodeObjectArray($object, $options, $encode);
    }
892266
public function createFilterForFilterData(ServerRequest $request, array $filterData)
    {
        $charlist = 'abcdefghikmnopqrstuvwxyz';

        do {
            $slug = '';
            for ($i = 0; $i < 14; $i++) {
                $slug .= substr($charlist, rand(0, 31), 1);
            }
        } while ($this->_slugExists($slug, $request));

        $this->save(new Filter([
            'plugin' => $request->getParam('plugin'),
            'controller' => $request->getParam('controller'),
            'action' => $request->getParam('action'),
            'slug' => $slug,
            'filter_data' => $this->_encodeFilterData($filterData)
        ]));

        return $slug;
    }
1058433
protected function getAssociationsFilter(string $filter = null)
    {
        $mappingConfiguration = new PropertyMappingConfiguration();
        $mappingConfiguration->setTypeConverter($this->typeConverterObjectConverter);
        $mappingConfiguration->setTypeConverterOption(\RGU\Dvoconnector\Property\TypeConverter\ObjectConverter::class, \RGU\Dvoconnector\Property\TypeConverter\ObjectConverter::CONFIGURATION_OBJECT, $this->getDefaultAssociationsFilter());

        return $this->convertAssociationsFilter($mappingConfiguration, $filter);
    }
151262
protected function createEntities(CodeGeneratorRequest $request)
    {
        $builder  = new EntityBuilder($request);
        $entities = $builder->buildEntities();

        return $entities;
    }
1323999
public function objectsList($filter = null, $params = null)
    {
        //====================================================================//
        // Stack Trace
        Splash::log()->trace();

        //====================================================================//
        // Prepare Query Builder
        /** @var QueryBuilder $queryBuilder */
        $queryBuilder = $this->repository->createQueryBuilder('c');
        // Setup Results Offset
        if (isset($params['offset']) && is_int($params['offset'])) {
            $queryBuilder->setFirstResult($params['offset']);
        }
        // Limit Results Number
        if (isset($params['max']) && is_int($params['max'])) {
            $queryBuilder->setMaxResults($params['max']);
        }

        //====================================================================//
        // Add List Filters
        if (!empty($filter)) {
        }

        //====================================================================//
        // Load Objects List
        $rawData = $queryBuilder->getQuery()->getResult();

        //====================================================================//
        // Parse Data on Result Array
        $response = array();
        foreach ($rawData as $object) {
            $response[] = $this->getObjectListArray($object);
        }

        //====================================================================//
        // Parse Meta Infos on Result Array
        $response['meta'] = array(
            'total' => count($rawData),
            'current' => $this->getTotalCount(),
        );

        //====================================================================//
        // Return result
        return $response;
    }
273491
protected function normalizeFilter(array $filter)
    {
        if (count($filter) < 2) {
            throw new ModuleException(
                __CLASS__,
                'Callback ' . json_encode($filter) . ' does not specify enough data for a filter: '
                . 'required at least tag and callback.'
            );
        }

        if (empty($filter[0]) || !is_string($filter[0])) {
            throw new ModuleException(__CLASS__, 'Callback ' . json_encode($filter) . ' does not specify a valid tag.');
        }

        if (count($filter) === 2) {
            $filter[] = $this->defaultPriority;
        }

        if (count($filter) === 3) {
            $filter[] = $this->defultAcceptedArguments;
        }

        if (count($filter) > 4) {
            throw new ModuleException(
                __CLASS__,
                'Callback ' . json_encode($filter) . ' contains too many arguments; '
                .'only tag, callback, priority and accepted arguments are supported'
            );
        }


        $callbackFunc = $filter[1];

        if (empty($callbackFunc) || !(is_string($callbackFunc) || is_array($callbackFunc))) {
            throw new ModuleException(
                __CLASS__,
                'Callback for ' . json_encode($filter) . ' is empty or the wrong type: '
                .'it should be a string (a function name) or an array of two strings (class name and a static method).'
            );
        }

        if (is_array($callbackFunc)) {
            if (!count($callbackFunc) === 2
                || count(array_filter($callbackFunc, 'is_string')) !== 2
            ) {
                throw new ModuleException(
                    __CLASS__,
                    'Callback for ' . json_encode($filter) . ' is weird: '
                    .'it should be a string (function name) or an array of two strings (class name and static method).'
                );
            }
        }

        return $filter;
    }
45095
public function getRequestString($object): string
    {
        $this->assertValid($object, ValidationException::RESPONSE);

        return $this->serializeBodyObject($object);
    }
186939
public function getSql($filter = []): string
    {
        if ($filter) {
            $this->filter($filter);
        }
        $qb = clone $this->getQueryBuilder();

        return $qb->toSQL();
    }
766452
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->name) && ($filter === null || isset($filter['name']))) {
			$output .= "\x0a";
			$output .= Binary::encodeVarint(strlen($object->name));
			$output .= $object->name;
		}

		if (isset($object->package) && ($filter === null || isset($filter['package']))) {
			$output .= "\x12";
			$output .= Binary::encodeVarint(strlen($object->package));
			$output .= $object->package;
		}

		if (isset($object->dependency) && ($filter === null || isset($filter['dependency']))) {
			foreach ($object->dependency instanceof \Traversable ? $object->dependency : (array)$object->dependency as $k => $v) {
				$output .= "\x1a";
				$output .= Binary::encodeVarint(strlen($v));
				$output .= $v;
			}
		}

		if (isset($object->publicDependency) && ($filter === null || isset($filter['publicDependency']))) {
			foreach ($object->publicDependency instanceof \Traversable ? $object->publicDependency : (array)$object->publicDependency as $k => $v) {
				$output .= "\x50";
				$output .= Binary::encodeVarint($v);
			}
		}

		if (isset($object->weakDependency) && ($filter === null || isset($filter['weakDependency']))) {
			foreach ($object->weakDependency instanceof \Traversable ? $object->weakDependency : (array)$object->weakDependency as $k => $v) {
				$output .= "\x58";
				$output .= Binary::encodeVarint($v);
			}
		}

		if (isset($object->messageType) && ($filter === null || isset($filter['messageType']))) {
			foreach ($object->messageType instanceof \Traversable ? $object->messageType : (array)$object->messageType as $k => $v) {
				$output .= "\x22";
				$buffer = DescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['messageType']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->enumType) && ($filter === null || isset($filter['enumType']))) {
			foreach ($object->enumType instanceof \Traversable ? $object->enumType : (array)$object->enumType as $k => $v) {
				$output .= "\x2a";
				$buffer = EnumDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['enumType']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->service) && ($filter === null || isset($filter['service']))) {
			foreach ($object->service instanceof \Traversable ? $object->service : (array)$object->service as $k => $v) {
				$output .= "\x32";
				$buffer = ServiceDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['service']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->extension) && ($filter === null || isset($filter['extension']))) {
			foreach ($object->extension instanceof \Traversable ? $object->extension : (array)$object->extension as $k => $v) {
				$output .= "\x3a";
				$buffer = FieldDescriptorProtoMeta::toProtobuf($v, $filter === null ? null : $filter['extension']);
				$output .= Binary::encodeVarint(strlen($buffer));
				$output .= $buffer;
			}
		}

		if (isset($object->options) && ($filter === null || isset($filter['options']))) {
			$output .= "\x42";
			$buffer = FileOptionsMeta::toProtobuf($object->options, $filter === null ? null : $filter['options']);
			$output .= Binary::encodeVarint(strlen($buffer));
			$output .= $buffer;
		}

		if (isset($object->sourceCodeInfo) && ($filter === null || isset($filter['sourceCodeInfo']))) {
			$output .= "\x4a";
			$buffer = SourceCodeInfoMeta::toProtobuf($object->sourceCodeInfo, $filter === null ? null : $filter['sourceCodeInfo']);
			$output .= Binary::encodeVarint(strlen($buffer));
			$output .= $buffer;
		}

		if (isset($object->syntax) && ($filter === null || isset($filter['syntax']))) {
			$output .= "\x62";
			$output .= Binary::encodeVarint(strlen($object->syntax));
			$output .= $object->syntax;
		}

		return $output;
	}
1038692
public static function toProtobuf($object, $filter = NULL)
	{
		$output = '';

		if (isset($object->start) && ($filter === null || isset($filter['start']))) {
			$output .= "\x08";
			$output .= Binary::encodeVarint($object->start);
		}

		if (isset($object->end) && ($filter === null || isset($filter['end']))) {
			$output .= "\x10";
			$output .= Binary::encodeVarint($object->end);
		}

		return $output;
	}