Idiorm is a lightweight nearly-zero-configuration object-relational mapper and fluent query builder for PHP 5.
Questions tagged [idiorm]
77 questions
18
votes
3 answers
How to POST backbone model data to DB through Slim php and Paris
I'm trying to get an understanding of how Backbone.js, Slim PHP and Paris/Idiorm might work together and I'm having trouble completing the flow, starting with model attribute data, all the way to the database. PROBLEM: What exactly gets sent to my…

jmk2142
- 8,581
- 3
- 31
- 47
5
votes
1 answer
Idiorm find_many() returns only one object
I've been playing with idiorm for a few days now, and little by little have managed to get it to actually start performing queries. I'm running into something a little odd though, and I can't figure it out. The find_many() function only returns one…

risingfish
- 354
- 3
- 9
3
votes
3 answers
Querying MySQL table with Idiorm/Paris
I've a Paris based model with its relative 'posts' table:
class Post extends Model {
public static $_table = 'posts';
public static $_id_column = 'id';
}
When I make a simple query to grab all posts:
$posts =…

S.C.
- 2,844
- 3
- 26
- 27
3
votes
1 answer
catching error in idiorm and paris orm?
I am using paris orm to develop a web application. I am adding data to the database and it fails, when i use a try catch block to catch the error it doesnt work.
My configurations are…

emabusi
- 51
- 1
- 7
3
votes
1 answer
Need help in Paris php quering
Example:
I have following two classes for tables in database.
class Post extends Model {}
class User extends Model {
public function posts() {
return $this->has_many('Post'); // Note we use…

Hikmat
- 450
- 4
- 19
3
votes
7 answers
Update a row using idiorm and php
I have this function to update a record, but i cannot it fails and send me a "Primary key ID missing from row or is null" message, how can I fix it?
public static function update_child($data)
{
try
{
$update=…

nullpointerexception
- 41
- 1
- 5
3
votes
1 answer
Message: Undefined index: id
I´ve my query
$proveedores = ORM::for_table('proveedor')->where_like('nombreproveedor',"%{$namesearch}%")->order_by_asc('nieproveedor')->find_many();
I want to save the id. I realize:
$_SESSION['idproveedor'] = $proveedores['id'];
My table…

Miguel Angulo Martínez
- 183
- 1
- 3
- 17
2
votes
2 answers
idiorm / paris has_many as_array result set
I'm having trouble getting the results of a has_many query using php idiorm/paris. Following the example from the paris site the has_many result for posts returns as an object.
That's great, and I can run through the object and access individual…

Unused
- 41
- 1
- 4
2
votes
1 answer
Idiorm pdo prepared statement
I want to use the following idiorm (orm): https://github.com/j4mie/idiorm.
It features following:
Built on top of PDO.
Uses prepared statements throughout to protect against SQL injection attacks.
Now, in…

MPavic
- 87
- 1
- 9
2
votes
2 answers
How to use own setter/getter with Idiorm/Paris?
I have a model (php class) and a table in my database. When I try to find_many without a where clause, it finds all database entries. And it creates a model for each of the database entries. But these models are empty and have no data assigned…

Jurik
- 3,244
- 1
- 31
- 52
2
votes
2 answers
How to use OR in idiorm SQL query in PHP?
I am developing an application using idiorm(https://github.com/j4mie/idiorm) for fetching data from database.
Here is my piece of code:
$messages = Model::factory('Messages')->where('from_user_id','1')->find_many();
I want to include an or…

Dasmond Miles
- 183
- 2
- 10
2
votes
1 answer
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails
I use idiorm + slim
I realize the following update query, but I try in the console phpmyadmin and it works.
update empleado set `nieempleado`='11111', nombre="Mickael", apellido1="aaa", apellido2="bbb", email="ma@gmail.com", puesto=0 where id =…

Miguel Angulo Martínez
- 183
- 1
- 3
- 17
2
votes
1 answer
How to union joins using Idiorm
I am using Idiorm for my SQL querying, and need to make a union of a right and left join.
Here is my actual SQL statement, which works:
SELECT p.*, a1.*, a2.szFirstName AS a2FirstName, a2.szLastName AS a2LastName,
a2.szEmail AS…

Yehuda Gutstein
- 381
- 10
- 27
2
votes
2 answers
How to retrieve information from an association table using Idiorm and Paris with only one query?
I am using Paris (which is built on top of Idiorm).
I have the following Model classes (example inspired from the documentation on github):
belongs_to('User');
…

Benjamin Crouzier
- 40,265
- 44
- 171
- 236
1
vote
1 answer
Simple PHP/MySQL ORM Code Not Executing
I'm trying to run a simple query with an ORM that is built on top of PDO.
Here's the code I'm trying to run:
$message = ORM::for_table("messages")
->where("to_user_id", $user_id)
->where("deleted", 0)
…

element119
- 7,475
- 8
- 51
- 74