Is there an option to use criteria Criteria::fromInput with Postgres ENUM custom field?
$query = Criteria::fromInput($this->di, 'Posts', $_POST);
$this->persistent->parameters = $query->getParams();
$parameters = $this->persistent->parameters;
Posts::find($parameters);
SQLSTATE[22P02]: Invalid text representation: 7 ОШИБКА: неверное значение для перечисления lang: "%EN%"
var_dump($query);
object(Phalcon\Mvc\Model\Criteria)[68]
protected '_model' => string 'Posts' (length=7)
protected '_params' =>
array (size=2)
'conditions' => string '[lang] LIKE :lang:' (length=18)
'bind' =>
array (size=1)
'lang' => string '%EN%' (length=4)
protected '_bindParams' => null
protected '_bindTypes' => null
protected '_hiddenParamNumber' => int 0
var_dump($this->db->describeColumns(posts));
...
object(Phalcon\Db\Column)[74]
protected '_name' => string 'lang' (length=4)
protected '_schemaName' => null
protected '_type' => int 2
protected '_typeReference' => int -1
protected '_typeValues' => null
protected '_isNumeric' => boolean false
protected '_size' => int 0
protected '_scale' => int 0
protected '_default' => string 'RU' (length=2)
protected '_unsigned' => boolean false
protected '_notNull' => boolean true
protected '_primary' => boolean false
protected '_autoIncrement' => boolean false
protected '_first' => boolean false
protected '_after' => string 'word' (length=4)
protected '_bindType' => int 2
...
Looks like model use enum field as text field and criteria then generate LIKE %field% instead of = field. Any chance to change it ?