public function getOrdered()
    {
        if (!$this->sort) {
            return $this->content;
        }

        $unordered = [];
        foreach ($this->content as $content) {
            $unordered[$content->getId()] = $content;
        }

        $ordered = [];
        $sort = json_decode($this->sort, true);
        $order = $sort['order'];
        foreach ($order as $id) {
            if (isset($unordered[$id])) {
                $ordered[] = $unordered[$id];
            }
        }

        return $ordered;
    }
public function getOrdered()
    {
        if (!$this->sort) {
            return $this->content;
        }

        $unordered = [];
        foreach ($this->content as $content) {
            $unordered[$content->getId()] = $content;
        }

        $ordered = [];
        $sort = json_decode($this->sort, true);
        $order = $sort['order'];
        foreach ($order as $id) {
            if (isset($unordered[$id])) {
                $ordered[] = $unordered[$id];
            }
        }

        return $ordered;
    }
public function getOrdered ( ) { if ( ! $ this -> sort ) { return $ this -> content ; } $ unordered = [ ] ; foreach ( $ this -> content as $ content ) { $ unordered [ $ content -> getId ( ) ] = $ content ; } $ ordered = [ ] ; $ sort = json_decode ( $ this -> sort , true ) ; $ order = $ sort [ 'order' ] ; foreach ( $ order as $ id ) { if ( isset ( $ unordered [ $ id ] ) ) { $ ordered [ ] = $ unordered [ $ id ] ; } } return $ ordered ; }
Get content items ordered by the sort property

@return array
Get content items ordered by the sort property