Welcome Guest, Not a member yet? Register   Sign In
IgnitedRecord 1.0 pre-release

[eluser]m4rw3r[/eluser]
In the case with new User(); (User is an IgnitedRecord model) you have to be careful so you don't init multiple instances of the model (which will create a mess with all the php references).

[eluser]Paul Apostol[/eluser]
Yes, you're right, can be a big mess, but let's hope I (we) didn't make it Smile
Maybe, just maybe (but with almost the same amount of text written as without using autoloading) I (we) can put a prefix to the class (as ex: M_User) or for HMVC to use as a prefix the module name (as ex: Auth_User) just for the avoid model naming collisions with small changes in autoload.
Don't know, depends on the taste of the developer.
IgnitedRecord is a nice ORM and IgnitedQuery is THE library.
Now I'll try to use it on a real world app. I hope I'll not change my ideas Smile)

[eluser]CtheB[/eluser]
Hi,

Is it possible to use Memcache or eAccelerator together with IgnitedRecord.
If so, what are best practices?
If not, which caching methode we can use with IgnitedRecord, and does somebody has experiences with it?

Thnx, Greetz Carlos

[eluser]Paul Apostol[/eluser]
Hi Carlos,
I don't see why not. Both are caching the code not the data. I never tested but I don't think that could be a problem, it's only a precompilation of a php script.
Paul

[eluser]m4rw3r[/eluser]
The record objects support it, they have their __wakeup() and __sleep() methods. Also the query objects should be able to be cached.
But don't forget to load the models before you load the record objects, or you wouldn't be able to run queries on them.

Btw, I'm planning to build some kind of caching interface (with drivers) for IR, but that is in a later version.

[eluser]Paul Apostol[/eluser]
Hello,
I'm amazing myself how lazy I am.
After writing 15 of the 60 models I have to make I had a crazy idea.
If I can make this? :
Code:
class Prefix1_Trax extends IgnitedRecord {
    var $habtm = array('table'=>'prefix2_data', 'join_prefix'=>'prefix3_');
    var $belongs_to = 'prefix4_name';

}
Code:
class Prefix2_Data {}
1. The name of the file and the class to be identical with the table
2. The first part of the name to be considered as prefix and when habtm is done to be striped and added as the prefix the join_prefix value
Somebody did this or something near?
Thanks

EDIT:
The name is the name of the model when is set in a relation?

[eluser]m4rw3r[/eluser]
I don't really understand how you want it to work.
Maybe an example of the intended result?

[eluser]ardinotow[/eluser]
Hi, m4rw3r
I find your form builder is the best and easy to customize. I need to update, show validation error, or show success message without leaving the form page or simply say I like to have my form to implement ajax. I use jquery form plugin from malsup.com. Can I use your form builder with ajax? And how to do it? Thx....

[eluser]Paul Apostol[/eluser]
Hi m4rw3r,
Really it's a crazy idea, I just asked if somebody did it Big Grin. We are fighting for naming conventions, and I'm sure it's unproductive.
The idea is like that:
- I have 2 tables, and a many to many relation: prefix1_table1, prefix2_table2, prefix3_table1_table2 (that doesn't mean if I have another set of table I'll use the same prefixes, I'm making modules and usually I prefix the tables needed for a certain module). The FK for the joining table is table1_id and table2_id. This is the most complex, I think, belongs to and has one is almost the same, eliminating the joining table.
- for simplicity I don't want to use plural of this and singular of that, sometimes I'm not working in EN. I just want to make the model "Prefix1_table1", to define a relation habtm as array('name'=>'prefix2_teable2', 'join_prefix'=>'prefix3_')
That's all.
Maybe a function for making the table and model names must be exposed.

In the end I'm still confused how the library is working. The user guide is not helping me at all. Sorry.
I didn't understood if the relation is opened using the model or is a local behavior. I can chain multiple relations? What is the most complex way to set a module's (not creating new functions)parameters.
Thank you very much.

[eluser]damarev[/eluser]
Sorry, I have read the manual and cant figure out by myself:

If I have a PROYECT model (id, name, status_id) and a STATUS model (id, name), how can I add the status name to the proyect model ?

Proyect model: $has_one = array('statuses');
Status model: $has_many = array('proyects');


Not begging for code... only a clue to point me in the right direction. Smile

Thanks a lot.




Theme © iAndrew 2016 - Forum software by © MyBB