How can I update a record in a database without using a sql statement with phalcon

0

Good morning

I have the following function.

/* Función para incrementar el contador para consecutivo de clientes*/
public function putAddConsecutiveClient($noCarteraSap)
{
    $model_get = new $this->modelClass;
    $model = $model_get::findFirst([
        "conditions" => ":noCarteraSap: BETWEEN desde AND hasta",
        "bind"       => ["noCarteraSap" => $noCarteraSap]
    ]);
    $model->contador = $model->contador + 1;

}

As far as I have already done what I want but how can I make the database update in the database without using a sql statement?

Is it possible?

Greetings and thanks

    
asked by Luis Enrique Gómez Pérez 12.12.2018 в 16:35
source

1 answer

0

The answer is yes, you can do it using the method save of class Model of Phalcon.

Anyway, comment that this is just an abstraction, obviously within use sentences for any CRUD operation (more or less optimized) and that to use Phalcon's ORM methods you should extend your class classes Model + follow the documentation.

    
answered by 12.12.2018 / 16:44
source