We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to select with a single command from this model?

I want to know how it would be a select with this model FindFirstby have problems with command and I think it's because I do not take in case sensitive exactly what would be the search if I wanted to search for the field and the field $ CONT_USUARIO $ CONT_CLAVE, and $ CONT_CODIGO field

<?php

class SpmContacto extends \Phalcon\Mvc\Model {

public $CONT_CODIGO;
public $CONT_CEDULA;
public $CONT_RUCIDE;
public $CONT_NOMBRE;
public $CON_ESTADO;
public $CONT_TELEFO;
public $CONT_DIRECC;
public $CONT_AREA;
public $CONT_CARGO;
public $CONT_TIPOXX;
public $CONT_EMAIL;
public $CONT_USUARIO;
public $CONT_CLAVE;
public $CONT_CLAVEE;

public function initialize()
{
    $this->setSchema("SPOLS");
    $this->setSource("'SPM_CONTACTO'");
    $this->hasMany('CONT_CODIGO', 'SpmReferencia', 'CONT_CODIGO', array('alias' => 'SpmReferencia'));
    $this->hasMany('CONT_CODIGO', 'SptDetalle', 'CONT_CODIGO', array('alias' => 'SptDetalle'));
    $this->hasMany('CONT_CODIGO', 'SptEncabezado', 'CONT_CODIGO', array('alias' => 'SptEncabezado'));
}

public static function find($parameters = null)
{
    return parent::find($parameters);
}

public static function findFirst($parameters = null)
{
    return parent::findFirst($parameters);
}
public function getSource()
{
    return 'SPM_CONTACTO';
}

}

What are you trying to findFirstBy? like base on which column?



81.1k

Yeah, right . I would like to know the code from the model, what is the line of code?