DataObjects setFrom and DB:quote woes
| From: | Jacob Singh | Date: | Sun, 04 Apr 2004 20:04:36 +0000 |
| Subject: | DataObjects setFrom and DB:quote woes | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-11616@lists.php.net to get a copy of this message | ||
love DataObjects I just discovered them yesterday, but they are killing me.
I am trying to do 2 things that I cannot wrap my head around.
1. I have a form that allows the admin to give 4 keywords to save with the
record. these keywords go into a field where they are stored comma
delimited. Whenever the site uses these keywords they are in array format.
I use $Content($_POST) to populate the table.
* $Content is the DataObject I'm working with
So my code looks something like:
PHP Code:
Class DataObjects_Content {
function setkeywords($v) {
$this->keywords = implode(",",$v);
}
function getKeywords() {
return explode(",",$this->keywords);
}
}
Only this doesn't work because in the DataObject function setFrom() checks
if the value is an array and if so, bypasses the field and doesn't call the
set function. Anyone know how to beat this, or why it is coded like that?
2. quote();
This one is really pissing me off. When I submit a text field, DataObjects
insists on putting tons of extra backslashes in. Every time I submit I get a
few new backslashes, they seem to grow exponetially.
PLEASE!! Some experienced PEAR people help me out with this. I promise I'll
help 10 newbies if I just get one response here.
thanks
Jacob
Jacob Singh
Technical Director
Calabashmusic.com
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.617 / Virus Database: 396 - Release Date: 3/9/2004