Example #1
0
 /**
  * Override the default execute function.
  * @return int
  */
 public function execute()
 {
     $result = parent::execute();
     if ($result->count() === 0) {
         return 0;
     } else {
         return $result->get()['COUNT(*)'];
     }
 }
Example #2
0
 /**
  * Get a select object for the current table.
  * @param  null $fields
  * @return Select
  */
 public function select($fields = null)
 {
     $select = new Select($this);
     if ($fields !== null) {
         $select->fields($fields);
     }
     return $select;
 }