where=`{"close_date":null}`<?php
$users = $modx->getCollection('modUser', $modx->fromJSON('{"remote_key":null}'));
foreach ($users as $user) {
var_dump($user->toArray());
}
array(1) { [0]=> array(1) { ["close_date"]=> NULL } }This is the function code:
public function where($criteria) {
if (is_array($criteria)) {
foreach ($criteria as $col => $v) {
$this->condition(array($col => $v));
}
} else {
$this->condition($criteria);
}
}
protected function condition($criteria) {
$this->_where[] = $criteria;
echo var_dump( $this->_where);
}SELECT * FROM `modx_jobs` WHERE `close_date` = "" ORDER BY `publishedon` DESC LIMIT 3