Fetch user content object id for the given field id.

@param int $fieldId

@return int
761645
protected function fetchUserId($fieldId)
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->select(
                $this->connection->quoteIdentifier('contentobject_id')
            )
            ->from($this->connection->quoteIdentifier('ezcontentobject_attribute'))
            ->where(
                $query->expr()->eq(
                    $this->connection->quoteIdentifier('id'),
                    ':fieldId'
                )
            )
            ->setParameter(':fieldId', $fieldId, PDO::PARAM_INT)
        ;

        $statement = $query->execute();

        return (int) $statement->fetchColumn();
    }
1214570
public function getContentIdByBlockId($id)
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->select($this->connection->quoteIdentifier('contentobject_id'))
            ->from($this->connection->quoteIdentifier('ezcontentobject_tree'), 't')
            ->innerJoin(
                't',
                $this->connection->quoteIdentifier(self::EZM_BLOCK_TABLE),
                'b',
                $query->expr()->eq(
                    $this->connection->quoteIdentifier('b.node_id'),
                    $this->connection->quoteIdentifier('t.node_id')
                )
            )
            ->where(
                $query->expr()->eq($this->connection->quoteIdentifier('b.id'), ':id')
            )
            ->setParameter(':id', $id, PDO::PARAM_STR)
        ;

        $statement = $query->execute();

        $contentId = $statement->fetchColumn();
        if ($contentId === false) {
            throw new NotFoundException('Block', $id);
        }

        return $contentId;
    }
1224592
public static function getFieldKey($fieldName, $fieldId)
    {
        if (isset(get_field_objects($fieldId)[$fieldName]['key'])) {
            return get_field_objects($fieldId)[$fieldName]['key'];
        }

        return false;
    }
152512
public function findOneByUserId($userId)
    {
        $qb = $this->createQueryBuilder();
        $qb->field('userId')->equals($userId);

        return $qb->getQuery()->getSingleResult();
    }
509876
public function getPerson($personId, $fields = ['*'])
    {
        $apiUrl = $this->getEndpoint('people');
        $apiUrl .= $personId;

        $params = array(
            'fields' => implode(',', $fields)
        );

        $apiData = $this->apiGet($apiUrl, $params);

        return $this->decodeSingle($apiData);
    }
356872
public static function objectId($fieldId)
    {
        //====================================================================//
        // decode
        $result = self::isIdField($fieldId);
        if (empty($result)) {
            return false;
        }
        //====================================================================//
        // Return List Name
        return   $result['ObjectId'];
    }
259709
public function findByObject($object, $fieldId = null)
    {
        $qb = $this->createQueryBuilder('cf');
        $this->addFindByObject($qb, 'cf', $object, $fieldId);

        return $qb->getQuery()->getResult();
    }
156468
private function isUserContent($contentId)
    {
        try {
            $this->repository->getUserService()->loadUser($contentId);

            return true;
        } catch (NotFoundException $e) {
            return false;
        }
    }
543524
public function get_user($userid) {
        global $DB;

        if (empty(self::$cachedusers[$userid])) {
            $fields = get_all_user_name_fields(true);
            self::$cachedusers[$userid] = $DB->get_record('user', array('id' => $userid), 'id, ' . $fields);
        }
        return self::$cachedusers[$userid];
    }
733718
public function deleteField($fieldId)
    {
        try {
            return $this->innerGateway->deleteField($fieldId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
849986
public function findId($id, $fields = '', $fetchMode=PDO::FETCH_ASSOC) {
		if (!empty($fields)) $this->driver->field($fields);
		return $this->driver->where($this->driver->id.'=?', $id)
            ->fetch($fetchMode);
	}
884747
protected function translateFieldCode(FieldsDefinition $fields, $fieldId)
    {
        $field = $fields->getField($fieldId);
        if ($field instanceof FieldInterface) {
            return  '{f' . $field->getOrder() . '}';
        }

        return $fieldId;
    }
536631
public static function findField($fieldsList, $fieldId)
    {
        $fields = self::filterFieldList($fieldsList, $fieldId);

        if (1 != count($fields)) {
            return null;
        }

        return array_shift($fields);
    }
1061146
private function getRecomId($content_area)
    {
        $id = $content_area->find('a', 0)->href;
        $id = explode('/', $id);

        return $id[4];
    }
990818
private function getObjectId($fieldName, $objectName = "object")
    {
        //====================================================================//
        // Load Pointed Object
        $object = $this->{$objectName}->{ "get".$fieldName}();
        //====================================================================//
        // Check Pointed Object Exists & Has an Id
        if (!$object || !method_exists($object, "getId") || !$object->getId()) {
            return null;
        }
        //====================================================================//
        // Return Object Id
        return (string) $object->getId();
    }
669548
public function loadContentInfoByLocationId($locationId)
    {
        try {
            return $this->innerGateway->loadContentInfoByLocationId($locationId);
        } catch (DBALException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        } catch (\PDOException $e) {
            throw new \RuntimeException('Database error', 0, $e);
        }
    }
716615
protected function getContentLocationIds($contentObjectId)
    {
        $query = $this->databaseHandler->createSelectQuery();
        $query->select('node_id')
            ->from($this->databaseHandler->quoteTable(self::CONTENTOBJECT_TREE_TABLE))
            ->where($query->expr->eq('contentobject_id', $contentObjectId));
        $stmt = $query->prepare();
        $stmt->execute();
        $nodeIds = $stmt->fetchAll(PDO::FETCH_COLUMN);

        return is_array($nodeIds) ? array_map('intval', $nodeIds) : [];
    }