Aleksander Machniak
2016-04-10 d54eb6c95104316180bbaa777f2d95f8d88c0f3c
program/lib/Roundcube/rcube_result_index.php
@@ -26,6 +26,8 @@
 */
class rcube_result_index
{
    public $incomplete = false;
    protected $raw_data;
    protected $mailbox;
    protected $meta = array();
@@ -231,27 +233,11 @@
    /**
     * Filters data set. Removes elements listed in $ids list.
     * Filters data set. Removes elements not listed in $ids list.
     *
     * @param array $ids List of IDs to remove.
     */
    public function filter($ids = array())
    {
        $data = $this->get();
        $data = array_diff($data, $ids);
        $this->meta          = array();
        $this->meta['count'] = count($data);
        $this->raw_data      = implode(self::SEPARATOR_ELEMENT, $data);
    }
    /**
     * Filters data set. Removes elements not listed in $ids list.
     *
     * @param array $ids List of IDs to keep.
     */
    public function intersect($ids = array())
    {
        $data = $this->get();
        $data = array_intersect($data, $ids);
@@ -273,7 +259,6 @@
            return;
        }
        // @TODO: maybe do this in chunks
        $data = $this->get();
        $data = array_reverse($data);
        $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data);
@@ -332,6 +317,7 @@
        if (empty($this->raw_data)) {
            return array();
        }
        return explode(self::SEPARATOR_ELEMENT, $this->raw_data);
    }