Pregunta

I have this database logic that need to be executed, I want to get all the rows selected by the user and deleted it.

My database logic would be getting all the rows and then delete individually.

I'm using Fuelphp 1.6 so my code is(as per stated on fuelphp forum topic in ORM):

Model_Article::find()->where('id', 'IN', array(1,3))->get();

The problem is I got this error:

Call to a member function where() on a non-object

Note: Model_Article extends ORM\Model

Can anybody help me? Thank you in advance.

¿Fue útil?

Solución

right... change your "select" to this:

Model_Article::find('all', array('where' => array('id', 'IN', array(1,3))))

OR change your select to

Model_Article::query()->where('id', 'IN', array(1,3))->get();

After you can do a "delete" in every record.

Otros consejos

The functionality to chain methods using Model::find()->foo().. was deprecated in 1.4 and removed in 1.5.

https://github.com/fuel/fuel/blob/1.6/master/CHANGELOG.md#removed-code-because-it-was-deprecated-in-v14-or-earlier

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top