Gets the pagination configuration.

@param iterable $object
772859
protected function getPaginationConfig($object, array $context = []): array
    {
        $currentPage = $lastPage = $itemsPerPage = $pageTotalItems = $totalItems = null;
        $paginated = $paginator = false;

        if ($object instanceof PartialPaginatorInterface) {
            $paginated = $paginator = true;
            if ($object instanceof PaginatorInterface) {
                $paginated = 1. !== $lastPage = $object->getLastPage();
                $totalItems = $object->getTotalItems();
            } else {
                $pageTotalItems = (float) \count($object);
            }

            $currentPage = $object->getCurrentPage();
            $itemsPerPage = $object->getItemsPerPage();
        } elseif (\is_array($object) || $object instanceof \Countable) {
            $totalItems = \count($object);
        }

        return [$paginator, $paginated, $currentPage, $itemsPerPage, $lastPage, $pageTotalItems, $totalItems];
    }
332563
public static function getTable($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->name;
        }
        else
        {
            return null;
        }
    }
231226
public function serialize($object)
    {
        $pageNumber = $object->getPageNumber();
        if ($object instanceof ArticlePageDocument) {
            // resolve proxy to ensure that this will also be serialized
            $object = $object->getParent();

            $object->getTitle();
        }

        $result = $this->serializer->serialize(
            $object,
            'json',
            SerializationContext::create()
                ->setSerializeNull(true)
                ->setGroups(['preview'])
        );

        return json_encode(['pageNumber' => $pageNumber, 'object' => $result]);
    }
350949
public function extract($object)
    {
        if (!$object instanceof PageEntityInterface) {
            throw new Exception\InvalidArgumentException(
                '$object must be an instance of PlaygroundCms\Entity\PageInterface'
            );
        }

        /* @var $object PageInterface*/
        $data = parent::extract($object);
        $data = $this->mapField('id', 'page_id', $data);

        return $data;
    }
784244
protected function getFetchPaginationResult(array $objects, $pagination)
    {
        if ($pagination) {
            $totalRowCount = $this->db->fetchValue('SELECT FOUND_ROWS()');

            return [$objects, $totalRowCount];
        } else {
            return $objects;
        }
    }
699491
public function getDataForRow($key, $object)
    {
        $translationManager = $this->framework->getInstance('\\Zepi\\Core\\Language\\Manager\\TranslationManager');
        
        switch ($key) {
            case 'name':
                return '<span class="mdi mdi-group"></span>' . $object->getName();
            break;
            
            case 'uuid':
                return $object->getUuid();
            break;
            
            case 'actions':
                $request = $this->framework->getRequest();
                return '<a href="' . $request->getFullRoute('administration/groups/modify/' . $object->getUuid()) . '" class="btn btn-primary"><span class="glyphicon glyphicon-pencil"></span>'
                     .     $translationManager->translate('Modify', '\\Zepi\\Web\\AccessControl')
                     . '</a>'
                     . '<a href="' . $request->getFullRoute('administration/groups/delete/' . $object->getUuid()) . '" class="btn btn-danger"><span class="glyphicon glyphicon-trash"></span>'
                     .     $translationManager->translate('Delete', '\\Zepi\\Web\\AccessControl')
                     . '</a>';
            break;
                
            default:
                return '-';
            break;
        }
    }
605059
public static function getAdvice($object, string $method = null, string $point = null): iterable
    {
        if (self::$advices === null) {
            self::$advices = new \SplObjectStorage();
        }

        $advices = self::$advices[$object] ?? [];

        if ($method !== null) {
            $advices = $advices[$method] ?? [];

            if ($point !== null) {
                $advices = $advices[$point] ?? [];
            }
        }

        return $advices;
    }
82796
public static function getClass($object) {
    if (!is_object($object))
      throw new \Psc\Exception('Cannot get Class from non-object value. '.self::varInfo($object));
    
    return get_class($object);
  }
962059
private function getObjectState($object)
    {
        $class = new \ReflectionClass($object);
        $visibility = \ReflectionProperty::IS_PRIVATE | \ReflectionProperty::IS_PROTECTED;
        $values = [];

        do {
            foreach ($class->getProperties($visibility) as $property) {
                $property->setAccessible(true);
                $values[$property->getName()] = $property->getValue($object);
            }

            $class = $class->getParentClass();
            $visibility = \ReflectionProperty::IS_PRIVATE;
        } while ($class);

        return get_object_vars($object) + $values;
    }
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;
    }
604497
public function extract($object)
    {
        if (!$object instanceof DownloadList) {
            throw new Exception('$object must be an instance of Downloadlist');
        }
        /* @var $object DownloadList */
        $data = parent::extract($object);

        return $data;
    }
421653
private static function getHydrator($object)
    {
        $class = get_class($object);

        if (!isset(self::$hydratorCache[$class])) {
            $configuration = new Configuration($class);
            $hydratorClass = $configuration->createFactory()->getHydratorClass();

            self::$hydratorCache[$class] = new $hydratorClass;
        }

        return self::$hydratorCache[$class];
    }
951472
private function serializeObject($object)
    {
        $payload = $this->getPayload($object);

        $curatedPayload = [];
        foreach ($payload as $key => $value) {
            $curatedPayload[$key] = $this->innerSerialize($value);
        }

        return $this->dataFormatter->format($this->classMapper->extractName(get_class($object)), $curatedPayload);
    }
121988
private function doMerge($object, array &$visited)
    {
        $oid = spl_object_hash($object);

        if (isset($visited[$oid])) {
            return $visited[$oid];
        }

        $visited[$oid] = $object;

        /** @var DocumentMetadata $class */
        $class = $this->manager->getClassMetadata(get_class($object));
        $managedCopy = $object;

        if (self::STATE_MANAGED !== $this->getDocumentState($object, self::STATE_DETACHED)) {
            $this->manager->initializeObject($object);

            $id = $class->getSingleIdentifier($object);
            $managedCopy = null;

            if (null !== $id) {
                $managedCopy = $this->manager->find($class->name, $id);

                if (null !== $managedCopy && self::STATE_REMOVED === $this->getDocumentState($managedCopy)) {
                    throw new \InvalidArgumentException('Removed document detected during merge.');
                }

                $this->manager->initializeObject($managedCopy);
            }

            if (null === $managedCopy) {
                $managedCopy = $this->newInstance($class);
                if (null !== $id) {
                    $class->setIdentifierValue($managedCopy, $id);
                }

                $this->persistNew($class, $managedCopy);
            }

            foreach ($class->getReflectionClass()->getProperties() as $property) {
                $name = $property->name;
                $property->setAccessible(true);

                if (! isset($class->associationMappings[$name])) {
                    if (! $class->isIdentifier($name)) {
                        $property->setValue($managedCopy, $property->getValue($object));
                    }
                } else {
                    // @todo
                }
            }
        }

        $visited[spl_object_hash($managedCopy)] = $managedCopy;
        $this->cascadeMerge($object, $managedCopy, $visited);

        return $managedCopy;
    }
1255166
private function serviceDescription($object) {
        $class_name = get_class($object);
        $methods = get_class_methods($class_name);
        $service = ["sdversion" => "1.0",
                    "name" => "DemoService",
                    "address" => $this->currentURL(),
                    "id" => "urn:md5:" . md5($this->currentURL())];
        $static = get_class_vars($class_name);
        foreach ($methods as $method_name) {
            $proc = array("name" => $method_name);
            $method = new \ReflectionMethod($class_name, $method_name);
            $params = array();
            foreach ($method->getParameters() as $param) {
                $params[] = $param->name;
            }
            $proc['params'] = $params;
            $help_str_name = $method_name . "_documentation";
            if (array_key_exists($help_str_name, $static)) {
                $proc['help'] = $static[$help_str_name];
            }
            $service['procs'][] = $proc;
        }
        return $service;
    }
1131626
public function query($object) {
		$conditions = (array) $this->constraints();

		foreach ($this->key() as $from => $to) {
			if (!isset($object->{$from})) {
				return null;
			}
			$conditions[$to] = $object->{$from};

			if (is_object($conditions[$to]) && $conditions[$to] instanceof Countable) {
				$conditions[$to] = iterator_to_array($conditions[$to]);
			}
		}
		$fields = $this->fields();
		$fields = $fields === true ? null : $fields;
		return compact('conditions', 'fields');
	}
1113649
public function extract( $object )
    {
        $result = array();
        $type   = $object->paragraph->type;

        $result['paragraph-' . $type] = $this->getParagraphMapper()
                                             ->extract( $object->paragraph );

        $propertyHydrator = $this->getHydrateSimpleProperties();

        foreach ( $object->rules as $key => $rule )
        {
            $result['customize-' . $key] = $propertyHydrator->extract( $rule )
                                                              [ 'properties' ];
        }

        return $result;
    }