Changes an contentobject's status

@param int $nodeID

@return array An array with operation status, always true
183189
static public function changeHideStatus( $nodeID )
    {
        $action = 'hide';

        $curNode = eZContentObjectTreeNode::fetch( $nodeID );
        if ( is_object( $curNode ) )
        {
            if ( $curNode->attribute( 'is_hidden' ) )
            {
                eZContentObjectTreeNode::unhideSubTree( $curNode );
                $action = 'show';
            }
            else
            {
                eZContentObjectTreeNode::hideSubTree( $curNode );
            }

            // Notify cache system about visibility change
            ezpEvent::getInstance()->notify('content/cache', [
                [(int)$nodeID],
                [(int)$curNode->attribute('contentobject_id')]
            ]);
        }

        //call appropriate method from search engine
        eZSearch::updateNodeVisibility( $nodeID, $action );

        return array( 'status' => true );
    }
302762
public function getObjectStatesForContent($contentId)
    {
        $groups = $this->objectStateService->loadObjectStateGroups();
        $contentInfo = $this->contentService->loadContentInfo($contentId);

        $contentObjectStates = array();

        foreach ($groups as $group) {
            try {
                $state = $this->objectStateService->getContentState($contentInfo, $group);
                $contentObjectStates[] = new RestObjectState($state, $group->id);
            } catch (NotFoundException $e) {
                // Do nothing
            }
        }

        return new ContentObjectStates($contentObjectStates);
    }
167510
protected function getChoice($contentId)
    {
        $choices = array();
        $content = $this->contentRepository->findOneByContentId($contentId);
        $choices[$content->getContentId()] = $content->getName();

        return $choices;
    }
107092
public function cancelContentId($contentId)
    {
        $params = array();
        $params['action'] = 'cancleContentIdAction';
        $params['appkey'] = $this->appkey;
        $params['contentId'] = $contentId;
        $rep = $this->httpPostJSON($this->host, $params);
        return (string)$rep['result'] === 'ok';
    }
917506
public function countLocationsByContentId($contentId)
    {
        try {
            return $this->innerGateway->countLocationsByContentId($contentId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
6771
public function deleteNodeAssignment($contentId, $versionNo = null)
    {
        try {
            return $this->innerGateway->deleteNodeAssignment($contentId, $versionNo);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
619591
public function swapNode( $nodeID, $selectedNodeID, $nodeIdList = array() )
    {
        $contentObject1 = eZContentObject::fetchByNodeID( $nodeID );
        $contentObject2 = eZContentObject::fetchByNodeID( $selectedNodeID );

        eZContentOperationCollection::registerSearchObject( $contentObject1->attribute( 'id' ) );
        eZContentOperationCollection::registerSearchObject( $contentObject2->attribute( 'id' ) );
    }
306104
public function deleteAction($contentId)
    {
        $repository = $this->get('open_orchestra_model.repository.content');
        $content = $repository->findOneByContentId($contentId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $content);

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $content)) {
            throw new ContentNotDeletableException();
        }

        $repository->softDeleteContent($contentId);
        $this->dispatchEvent(ContentEvents::CONTENT_DELETE, new ContentDeleteEvent($contentId, $content->getSiteId()));

        return array();
    }
660823
public function getInheritSort($nodeId)
    {
        if (isset($this->attributes['inheritSort'][$nodeId])) {
            return $this->attributes['inheritSort'][$nodeId];
        }

        return $this->sort;
    }
288839
public function deleteContent($contentId)
    {
        $query = $this->dbHandler->createDeleteQuery();
        $query->deleteFrom('ezcontentobject')
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('id'),
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
                )
            );

        $query->prepare()->execute();
    }
994078
static function getSubtreeModification( $nodeID )
    {
        if ( $nodeID === false )
            return -1;
        $nodeID = (int)$nodeID;
        $sql = "SELECT modified_subnode FROM ezcontentobject_tree WHERE node_id=$nodeID";
        $db = eZDB::instance();
        $rows = $db->arrayQuery( $sql );
        if ( count( $rows ) > 0 )
            return $rows[0]['modified_subnode'];
        return -1;
    }
272101
protected function getObjectStateIds($contentId)
    {
        $objectStateIds = array();

        foreach ($this->objectStateHandler->loadAllGroups() as $objectStateGroup) {
            $objectStateIds[] = $this->objectStateHandler->getContentState(
                $contentId,
                $objectStateGroup->id
            )->id;
        }

        return $objectStateIds;
    }
58862
private function getMainNodeId($contentId)
    {
        $query = $this->handler->createSelectQuery();
        $query
            ->select('node_id')
            ->from($this->handler->quoteTable('ezcontentobject_tree'))
            ->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->handler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentId, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->handler->quoteColumn('node_id'),
                        $this->handler->quoteColumn('main_node_id')
                    )
                )
            );
        $statement = $query->prepare();
        $statement->execute();

        $result = $statement->fetchAll(\PDO::FETCH_ASSOC);
        if (count($result) === 1) {
            return (int)$result[0]['node_id'];
        } else {
            return false;
        }
    }
1366545
static function removeRecentByNodeID( $nodeID )
    {
        $db = eZDB::instance();
        $nodeID =(int) $nodeID;
        $db->query( "DELETE FROM ezcontentbrowserecent WHERE node_id=$nodeID" );
    }
91741
public function deleteAction($nodeId)
    {
        $siteId = $this->get('open_orchestra_backoffice.context_backoffice_manager')->getSiteId();
        $nodeRepository = $this->get('open_orchestra_model.repository.node');

        $node = $nodeRepository->findOneByNodeAndSite($nodeId, $siteId);
        $this->denyAccessUnlessGranted(ContributionActionInterface::DELETE, $node);

        if (!$this->get('open_orchestra_backoffice.business_rules_manager')->isGranted(BusinessActionInterface::DELETE, $node)) {
            throw new NodeNotDeletableException();
        }

        $nodeRepository->softDeleteNode($nodeId, $siteId);
        $this->dispatchEvent(NodeEvents::NODE_DELETE, new NodeDeleteEvent($nodeId, $siteId));

        return array();
    }
792704
public function getMostRevelantItemForNode($nodeId)
    {
        if (isset($this->perNode[$nodeId])) {
            return reset($this->perNode[$nodeId]);
        }
    }
552082
public function apply($contentId)
    {
        $versionNumbers = $this->contentGateway->listVersionNumbers($contentId);
        $languageCodeToFieldId = array();

        $nameRows = $this->contentGateway->loadVersionedNameData(
            array_map(
                function ($versionNo) use ($contentId) {
                    return array('id' => $contentId, 'version' => $versionNo);
                },
                $versionNumbers
            )
        );

        foreach ($versionNumbers as $versionNo) {
            $contentRows = $this->contentGateway->load($contentId, $versionNo);
            $contentList = $this->contentMapper->extractContentFromRows($contentRows, $nameRows);
            $content = $contentList[0];
            $languageCodeSet = array();

            // Each subsequent Content version can have additional language(s)
            foreach ($content->fields as $field) {
                $languageCode = $field->languageCode;

                // Add once for each language per version
                if (isset($languageCodeSet[$languageCode])) {
                    continue;
                }

                $languageCodeSet[$languageCode] = true;

                // Check if field was already inserted for current language code,
                // in that case we need to preserve its ID across versions
                if (isset($languageCodeToFieldId[$languageCode])) {
                    $fieldId = $languageCodeToFieldId[$languageCode];
                } else {
                    $fieldId = null;
                }

                $languageCodeToFieldId[$languageCode] = $this->insertField(
                    $content,
                    $this->createField(
                        $fieldId,
                        $versionNo,
                        $languageCode
                    )
                );
            }
        }
    }