public function getCollectionBy($field, $value)
{
if (!is_array($value)) {
$value = array($value);
}
$count = count($value);
if ($count === 0) {
return array();
} elseif ($count === 1) {
$result = $this->execute('SELECT * FROM ' . $this->tableName . ' WHERE `' . $field . '` =?', $value);
} else {
$stmt = $this->buildInQuery($field, $value);
$result = $this->execute('SELECT * FROM ' . $this->tableName . ' WHERE ' . $stmt, $value);
}
$data = $result->fetchAll();
if (!is_array($data)) {
$data = array();
}
return $data;
}