ConversationModel::getCountWhere PHP Method

getCountWhere() public method

Get number of conversations that meet criteria.
Since: 2.0.0
public getCountWhere ( array $Wheres = '' ) : integer
$Wheres array SQL conditions.
return integer Number of messages.
    public function getCountWhere($Wheres = '')
    {
        if (is_array($Wheres)) {
            $this->SQL->where($Wheres);
        }
        $Data = $this->SQL->select('ConversationID', 'count', 'Count')->from('Conversation')->get();
        if ($Data->numRows() > 0) {
            return $Data->firstRow()->Count;
        }
        return 0;
    }