public function get($idSegment)
    {
        Piwik::checkUserHasSomeViewAccess();

        if (!is_numeric($idSegment)) {
            throw new Exception("idSegment should be numeric.");
        }

        $segment = $this->getModel()->getSegment($idSegment);

        if (empty($segment)) {
            return false;
        }
        try {

            if (!$segment['enable_all_users']) {
                Piwik::checkUserHasSuperUserAccessOrIsTheUser($segment['login']);
            }

        } catch (Exception $e) {
            throw new Exception($this->getMessageCannotEditSegmentCreatedBySuperUser());
        }

        if ($segment['deleted']) {
            throw new Exception("This segment is marked as deleted. ");
        }

        return $segment;
    }
public function get($idSegment)
    {
        Piwik::checkUserHasSomeViewAccess();

        if (!is_numeric($idSegment)) {
            throw new Exception("idSegment should be numeric.");
        }

        $segment = $this->getModel()->getSegment($idSegment);

        if (empty($segment)) {
            return false;
        }
        try {

            if (!$segment['enable_all_users']) {
                Piwik::checkUserHasSuperUserAccessOrIsTheUser($segment['login']);
            }

        } catch (Exception $e) {
            throw new Exception($this->getMessageCannotEditSegmentCreatedBySuperUser());
        }

        if ($segment['deleted']) {
            throw new Exception("This segment is marked as deleted. ");
        }

        return $segment;
    }
public function get ( $ idSegment ) { Piwik :: checkUserHasSomeViewAccess ( ) ; if ( ! is_numeric ( $ idSegment ) ) { throw new Exception ( "idSegment should be numeric." ) ; } $ segment = $ this -> getModel ( ) -> getSegment ( $ idSegment ) ; if ( empty ( $ segment ) ) { return false ; } try { if ( ! $ segment [ 'enable_all_users' ] ) { Piwik :: checkUserHasSuperUserAccessOrIsTheUser ( $ segment [ 'login' ] ) ; } } catch ( Exception $ e ) { throw new Exception ( $ this -> getMessageCannotEditSegmentCreatedBySuperUser ( ) ) ; } if ( $ segment [ 'deleted' ] ) { throw new Exception ( "This segment is marked as deleted. " ) ; } return $ segment ; }
Returns a stored segment by ID

@param $idSegment
@throws Exception
@return bool
Returns a stored segment by ID