/**
* Get count of data
* @return int
*/
public function getCount()
{
try {
$primary = $this->data_source->getPrimary();
} catch (\LogicException $e) {
return $this->data_source->count('*');
}
return $this->data_source->count($this->data_source->getName() . '.' . (is_array($primary) ? reset($primary) : $primary));
}