I'm attempting to use Predicates within ZF2 in order to query on a date
type column named column_date
Nothing seems to work for the any columns and I am so new I am unsure where to start..
$query = $this->tableGateway->getSql()->select();
$predicate = new Where();
$query->where($predicate->equalTo('user_id' , $params['user_id']));
$query->where($predicate->equalTo('super_type', 'steep'));
$query->where($predicate->greaterThan('column_date',$dateRangeArray[0]));
$query->where($predicate->lessThan('column_date', $dateRangeArray[1]));
$rowset = $this->tableGateway->select($query);
$resultArr = $rowset->toArray();
This is returning things that have incorrect user_id
, incorrect column_date
in them.. why?
dateRangeArray
looks like this :
dateRangeArray[0] = 2014-09-01
dateRangeArray[1] = 2015-09-01