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

[eluser]sankai[/eluser]
Is the IR support the HMVC?

[eluser]kostia[/eluser]
m4rw3r,

1. do you have date type to handle it in the forms?


2. do you know how to resolve the trouble if a field is described act_as
Code:
'firstname' => array('rules' => 'max_length[64]|alpha',
            'label' => 'first name',
            'desc' => 'individual or first name'),
alpha - or any alpha-related rule causes an error if the field is empty, i.e. incurring behavior like required.


3. how to get the id of a newly created record?
Code:
$entry = $this->individuals->new_record();
$entry->validate('firstname');
$entry->save();
   $id = .....
$individual = $this->individuals->find($id);
thanks

[eluser]m4rw3r[/eluser]
@sankai:

Yes, it does support it.

I haven't made thorough testing though.
The only thing I can say for now is to not use factory*() without setting the $model_name property in the created models.
Otherwise everything should work (with 1.0 at least).

[eluser]m4rw3r[/eluser]
@kostia:

1:
Not for the moment, it is still alpha.
Just add a "date" case in the switch in the IR_form.php view and then the code for it there.
(You're welcome to contribute it, if you want)

2:
I've change the regex to match any instead of 1+ (I've copied it from CI's form_validation class, so it was identical)
I agree with you, alpha should return true on an empty string because required is there to prevent it.

3:
Fixed so you can use $entry->id (or whatever your pk is) in SVN (rev 233)

[eluser]kostia[/eluser]
m4rw3,

2.,3. I would appreciate if you would indicate files you are actually changing. The web interface doesn't track dates. Look
here in SVN. I'd like to know where to look after and what files to update.

1. Well it'll be difficult. I'm not very experienced in CI or even PHP. The choice of your library is solely because of profanity in use of related DB objects, i.e. it is more humanly interface for programing. Do you agree that find an error is much easier than correcting it properly?

thanks

[eluser]m4rw3r[/eluser]
I recommend to use the trac Timeline feature you can find here, it shows the changes that have been made
(but a tool like Tortoise SVN is even better if you use SVN a lot).

I'll see what I can do about the date field.

About errors; Yes it is easier to find them than correct them (unless it is typos on var names Wink )

[eluser]voland[/eluser]
[quote author="m4rw3r" date="1227329253"]About "real" cascading deletes:...[/quote]
Thanks for this functionality. IR - great and highly progress lib. But no easy way to add cascading to relation at this moment.
(IR_RelProperty has accessors and field for cascade_on_delete, but it doesn't initialize in constructor)

[eluser]m4rw3r[/eluser]
Whoops!

I test IR by using the factory() method and then I call all the necessary methods, therefore I missed that.
It is now fixed.

[eluser]kostia[/eluser]
m4rw3r,

alpha still doesn't work properly [version.234]. It refuses to accept spaces.

[eluser]m4rw3r[/eluser]
That is the nature of the alpha rule, no spaces - just ^[A-Za-z]*$ .

So a simple solution is to use your own filter method:
Code:
'rules' => 'trim|required|max_length[20]|your_rule'
// if your_rule isn't fund in the validation class it will search for it elsewhere
// this is the order of search:
// 1: Validation class (IR's, with preceding underscore)
// 2: Model object
// 3: Controller object
// 4: Callable (PHP functions and ordinary ones + static methods)

// in your controller or model (or a function outside them)

function your_rule($str)
{
    return preg_match("/^([a-z ])*$/i", $str); // added a space in the regex
}
btw, you can also call static rules: 'rules' => 'trim|MY_class::Some_static_method[2]' Wink




Theme © iAndrew 2016 - Forum software by © MyBB