@param PageInterface $object

@return mixed|void
966572
public function postRemove($object)
    {
        $contentRoute = $object->getContentRoute();

        try {
            $this->getModelManager()->delete($contentRoute);
        } catch (\Exception $e) {
            var_dump($e);
            die;
        }
    }
1359356
public function postUpdate(PageInterface $page, LifecycleEventArgs $event)
    {
        /** @var \Doctrine\ORM\EntityManagerInterface $em */
        $em = $event->getObjectManager();
        $uow = $em->getUnitOfWork();

        $changeSet = $uow->getEntityChangeSet($page);
        if (array_key_exists('enabled', $changeSet)) {
            if ($page->isEnabled()) {
                $this->discardPageRedirections($page);
            } else {
                $this->buildPageRedirections($page);
            }
        }
    }
1267844
protected function _lock($object, $lock)
    {
        if ($lock) {
            self::$_locks[$object->getHandle()] = true;
        } else {
            unset(self::$_locks[$object->getHandle()]);
        }
    }
572639
public function insertObject(ObjectInterface $object)
    {
        $this->writer->insertOne(iterator_to_array($this->projectObject($object)));

        return $this;
    }
1283873
public function postRemove($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);
        $block->postRemove($object);
    }
488151
function stop_object($object) {
		if (! isset ($this->_objs[$object])) {
			return;
		}

		$start = $this->_objs[$object]["start_page"];
		$where = $this->_objs[$object]["where"];

		// Place the object on this page if required
		$page_number = $this->_pdf->PageNo();
		if ($page_number >= $start &&
		(($page_number % 2 == 0 && $where == "even") ||
		($page_number % 2 == 1 && $where == "odd") ||
		($where == "all"))) {
			$data = $this->_pdf->getObject($object);
			$this->_pdf->setPageBuffer($page_number, $data['c'], true);
		}

		unset ($this->_objs[$object]);
	}
1220258
public function persist(IdentifiableObject $object): void
    {
        $id = (string)$object->id();

        $allData = $this->loadAllObjects();
        $allData[$id] = $object;
        $this->saveAllObjects($allData);

        stdout(line(make_cyan('Persisted'), get_class($object), ':', $id));
    }
397904
public function update(EntityInterface $entity): void
    {
        $uri = $this->getEntityEndpointUri($entity->id());
        $response = $this->getClient()->put(
            $uri,
            $this->getEntitySerializer()->serialize($entity, 'json')
        );
        $this->getEntitySerializer()->setPropertiesFromResponse($response, $entity);
    }
634050
private function discardPageRedirections(PageInterface $page)
    {
        if ($page->isEnabled()) {
            /** @var \Ekyna\Bundle\CmsBundle\Model\PageTranslationInterface $translation */
            foreach ($page->getTranslations() as $locale => $translation) {
                // TODO use url generator or i18n routing prefix strategy
                $localePrefix = $locale != 'fr' ? '/' . $locale : '';
                $event = new DiscardRedirectionEvent($localePrefix . $translation->getPath());
                $this->dispatcher->dispatch(RedirectionEvents::DISCARD, $event);
            }
        }
    }
351221
public function with(ObjectInterface $object): self
    {
        $clone = clone $this;
        $clone->objects[$object->getId()] = $object;
        $clone->array[$object->getId()] = $object->getInstance();

        return $clone;
    }
1068988
public function preUpdate(PageInterface $page, PreUpdateEventArgs $event)
    {
        $em = $event->getEntityManager();
        $uow = $em->getUnitOfWork();

        if ($this->handlePage($page)) {
            $metadata = $em->getClassMetadata(get_class($page));
            $uow->recomputeSingleEntityChangeSet($metadata, $page);
        }

        /*$changeSet = $event->getEntityChangeSet();
        if (array_key_exists('enabled', $changeSet)) {
            if ($page->isEnabled()) {
                $this->discardPageRedirections($page);
            } else {
                $this->buildPageRedirections($page);
            }
        }*/
    }
1012998
public function inject($object) : void
    {
        $reflection = new \ReflectionObject($object);

        $this->injectProperties($reflection, $object);
        $this->injectMethods($reflection, $object);
    }
185180
public function fixUrl(PageInterface $page)
    {
        if ($page->isInternal()) {
            $page->setUrl(null); // internal routes do not have any url ...

            return;
        }

        // hybrid page cannot be altered
        if (!$page->isHybrid()) {
            // make sure Page has a valid url
            if ($page->getParent()) {
                if (!$page->getSlug()) {
                    $page->setSlug(Page::slugify($page->getName()));
                }

                if ('/' === $page->getParent()->getUrl()) {
                    $base = '/';
                } elseif ('/' !== mb_substr($page->getParent()->getUrl(), -1)) {
                    $base = $page->getParent()->getUrl() . '/';
                } else {
                    $base = $page->getParent()->getUrl();
                }

                if ('page_slug' === $page->getRouteName()) {
                    $page->setUrl($base . $page->getSlug() . '/');
                }
            } else {
                // a parent page does not have any slug - can have a custom url ...
                $page->setSlug(null);
                $page->setUrl('/' . $page->getSlug());
            }
        }

        foreach ($page->getChildren() as $child) {
            $this->fixUrl($child);
        }
    }
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]);
    }
393663
public function set(): PageInterface
    {
        $hook = $this->isNetwork() ? 'network_admin_menu' : 'admin_menu';

        // Action for page display.
        $this->action->add($hook, [$this, 'build']);
        // Action for page settings.
        $this->action->add('admin_init', [$this, 'configureSettings']);

        return $this;
    }
727551
public function save(DomainObjectInterface &$domainObject): void
    {
        if ($domainObject->getId() === 0) {
            $this->concreteInsert($domainObject);
        }

        $this->concreteUpdate($domainObject);
    }
817471
public function preUpdate($object): void
    {
        /** @var BlockAdmin $block */
        $block = $this->blockManager->get($object);

        $block->preUpdate($object);

        // fix weird bug with setter object not being call
        $object->setChildren($object->getChildren());

        $dashboard = $object->getDashboard();

        if ($dashboard instanceof DashboardInterface) {
            $dashboard->setEdited(true);
        }
    }