How can i do to use method populate but to not populate one field because i seted the value before.
You can set the value after...
$foo = new Foo();
$foo->populate();
$foo->setValue('value');
$foo->store();
this is the problem i need to set before.
If you seted the value before populate() but after POST, you can use fRequest::set('field', 'value') to modify this value.
PD. BTW, I can't figure out why you don't set the value after populate and you has to set it before... Can you post some piece of code in order to clarify me?
it takes the value from another field and made some changes for friendly url.
tank you it's working that way.
If you want to make sure the column is always a friendly URL, I would highly recommend adding that functionality to your fActiveRecord class.
class Foo
{
public function setValue($value)
{
return $this->set('value', fURL::makeFriendly($value));
}
}
This custom ->setValue()
method will get called by fActiveRecord::populate().
can u add a parameter fo chose the separator
I presume you are talking about fURL::makeFriendly()?
I've seen some chatter about it on the forum, but no one has submitted a ticket yet. I try to respond to forum posts, but there is no mechanism for me to keep track of what has and hasn't been addressed in the forum. If a ticket is submitted I can keep track of it pretty easily and make sure it either gets fixed, or a reason for it not being fixed is recorded.
This sounds cool!
Is this feature undocumented? Is there the same functionality for something like getValue()
?
Yes, it is also possible for getting values. fActiveRecord has protected methods ::get()
and ::set()
that accept a column name, and in the case of ::set()
, additionally a value.
From glancing around the documentation it does not appear that it is specifically mentioned anywhere. If you don't mind opening a ticket for it, then I can make sure it gets added. Thanks!