Retrieve list of comments.

@param array $filter

@return array

@link http://codex.wordpress.org/XML-RPC_WordPress_API/Comments#wp.getComments
969156
function getComments(array $filter = array())
    {
        $params = array(1, $this->username, $this->password, $filter);

        return $this->sendRequest('wp.getComments', $params);
    }
357340
public function clientList(array $filter = array())
  {
    if($this->clientList === null)
    {
      $clients = $this->request("clientlist -uid -away -badges -voice -info -times -groups -icon -country -ip")->toAssocArray("clid");

      $this->clientList = array();

      foreach($clients as $clid => $client)
      {
        if($this->getParent()->getExcludeQueryClients() && $client["client_type"]) continue;

        $this->clientList[$clid] = new Client($this, $client);
      }

      uasort($this->clientList, array(__CLASS__, "sortClientList"));

      $this->resetNodeList();
    }

    return $this->filterList($this->clientList, $filter);
  }
614507
private function getGitRepositories(array $filter)
    {
        $allGitRepositories = $this->app->make(GitRepositoryRepository::class)->findAll();
        if (empty($allGitRepositories)) {
            throw new Exception('No git repository defined');
        }
        if (count($filter) === 0) {
            $result = $allGitRepositories;
        } else {
            $result = [];
            foreach ($filter as $f) {
                $found = null;
                foreach ($allGitRepositories as $r) {
                    if (strcasecmp($r->getName(), $f) === 0) {
                        if ($found !== null) {
                            throw new Exception("Duplicated repository specified: $f");
                        } else {
                            $found = $r;
                        }
                    }
                }
                if ($found === null) {
                    throw new Exception("Unable to find a repository with name $f");
                }
                $result[] = $found;
            }
        }

        return $result;
    }
657038
public function getUnpublishedComments($blogId, $filters)
    {
        if (!isset($filters['hiddenFilters'])) {
            $filters['hiddenFilters'] = [];
        }
        //filter on current blog and post
        $filters['hiddenFilters'] = array_merge(
            $filters['hiddenFilters'],
            [
                'blog' => $blogId,
                'status' => false,
            ]);

        return $this->finder->search('Icap\BlogBundle\Entity\Comment', $filters);
    }
412717
public static function getItems($filter = []): array
    {
        $res = [];

        /* @var $class LightModel */
        $className = get_called_class();
        $class = new $className;

        $sql = 'SELECT * FROM ' . $class->getTableName() . ' WHERE 1=1';
        $params = self::handleFilter($sql, $filter, $class);

        $query = DB::getConnection()->prepare($sql);
        $query->execute($params);

        foreach ($query->fetchAll(PDO::FETCH_CLASS, $className) as $item)
        {
            $res[] = self::typeCastModel($item);
        }

        return $res;
    }
182705
protected function filterContainsZip($filter)
    {
        $return = [];

        if (
            (isset($filter->string) && preg_match('/^\d{5}(?:[-\s]\d{4})?$/', $filter->string))
            || false !== strpos(serialize($filter), 'zipcode')
        ) {
            $return = ['l.zipcode'];
        }

        return $return;
    }
267681
public static function getCurrencies($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/currencies' . $filter->toQuery(), 'Currency');
    }
1195913
public function query(): array
    {
        $comments = Comment::with([
            'post' => function ($query) {
                $query->select('id', 'type', 'slug');
            },
        ])->latest()
            ->paginate();

        return [
            'comments' => $comments,
        ];
    }
1155347
public function channelGroupList(array $filter = array())
    {
        if ($this->cgroupList === null) {
            $this->cgroupList = $this->request("channelgrouplist")->toAssocArray("cgid");

            foreach ($this->cgroupList as $cgid => $group) {
                $this->cgroupList[$cgid] = new Channelgroug($this, $group);
            }

            uasort($this->cgroupList, array(__CLASS__, "sortGroupList"));
        }

        return $this->filterList($this->cgroupList, $filter);
    }
1058131
public function filter($filter)
    {
        preg_match_all("/(#\w+)/", $filter, $entityNames);
        preg_match_all("/(:\w+)/", $filter, $positions);

        $entityName = is_array($entityNames[0]) && isset($entityNames[0][0]) ? ltrim($entityNames[0][0], '#') : null;
        $position   = is_array($positions[0]) && isset($positions[0][0]) ? $positions[0][0] : null;

        $i = 0;

        $filtered = [];

        foreach ($this->entities as $name => $entity) {
            if ($i === 0 && ($entityName === $name || $entityName === null) && ($position === ':first' || $position === ':highest' || $position === null)) {
                $filtered[] = $entity;
            }

            if ($position === ':any' && ($entityName === $name || $entityName === null)) {
                $filtered[] = $entity;
            }

            if ($i + 1 === $this->entities->count() && ($entityName === $name || $entityName === null) && ($position === ':last' || $position === ':lowest')) {
                $filtered[] = $entity;
            }

            $i++;
        }

        $this->filtered = $filtered;

        return $this;
    }
587734
public static function getCoupons($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCollection('/coupons' . $filter->toQuery(), 'Coupon');
    }
846183
public function getSentMessages($filters=array())
	{
		$entries = $this->buildQuery($filters);
		$entries->order($entries->getTableName() . '.created', 'desc');

		if (isset($filters['limit']) && $filters['limit'] != 0)
		{
			$entries->limit($filters['limit'])
				->start($filters['start']);
		}

		return $entries->rows();
	}
1161085
public function getErrors($filter = null)
    {
        // Create an array to hold errors
        $messages = [];

        // If we have no errors, abort
        if ( ! $this->errors->count()) return $messages;

        foreach ($this->errors->toArray() as $key => $error)
        {
            $messages[$key] = $this->extractErrors($error);
        }

        // Return a specific set of messages if asked
        return array_get($messages, $filter);
    }
1242927
public function clientList(array $filter = array())
  {
    $clients = array();

    foreach($this->getParent()->clientList() as $client)
    {
      if($client["cid"] == $this->getId())
      {
        $clients[$client->getId()] = $client;
      }
    }

    return $this->filterList($clients, $filter);
  }
702693
public static function getCategoriesCount($filter = array())
    {
        $filter = Filter::create($filter);
        return self::getCount('/categories/count' . $filter->toQuery());
    }
1166091
public function getServices($filter = null)
	{
		$services = array();

		// Create the request
		$request = new client\Request('/api/mpegts/service/grid');

		if ($filter)
			$request->setFilter($filter);

		// Get the response
		$response = $this->_client->getResponse($request);
		$rawContent = $response->getContent();

		$content = json_decode($rawContent);

		foreach ($content->entries as $entry)
			$services[] = model\Service::fromRawEntry($entry);

		return $services;
	}
1367963
public function getReportedComments($blogId, $filters)
    {
        if (!isset($filters['hiddenFilters'])) {
            $filters['hiddenFilters'] = [];
        }
        //filter on current blog and post
        $filters['hiddenFilters'] = array_merge(
            $filters['hiddenFilters'],
            [
                'blog' => $blogId,
                'reported' => 1,
            ]);

        return $this->finder->search('Icap\BlogBundle\Entity\Comment', $filters);
    }