* @package Mammut\DB\Sql */ trait Limitable { /** * Limit the number of rows affected by the query * * @param int $limit * @return $this */ public function limit($limit) { if(!is_numeric($limit)) throw new \InvalidArgumentException(sprintf('%s expects parameter to be numeric, "%s" given', __METHOD__, (is_object($limit) ? get_class($limit) : gettype($limit)))); $this->setup[self::LIMIT] = $limit; return $this; } }