Example #1
0
 /**
  * Callback function that filters collection by field "Used" from grid
  *
  * @param AbstractCollection $collection
  * @param Column $column
  * @return void
  */
 public function addIsUsedFilterCallback($collection, $column)
 {
     $filterValue = $column->getFilter()->getCondition();
     $expression = $this->getConnection()->getCheckSql('main_table.times_used > 0', 1, 0);
     $conditionSql = $this->_getConditionSql($expression, $filterValue);
     $collection->getSelect()->where($conditionSql);
 }
 public function testGetAllIdsWithBind()
 {
     $this->_model->getSelect()->where('code = :code');
     $this->_model->addBindParam('code', 'admin');
     $this->assertEquals(['0'], $this->_model->getAllIds());
 }