DataObjects
| From: | Barry Steele | Date: | Mon, 19 May 2003 23:35:33 +0000 |
| Subject: | DataObjects | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-5444@lists.php.net to get a copy of this message | ||
hi,
Does anyone have some examples of extending the Validation part of a
DataObject?
I'm a little slow and the stuff in the manual is not shining a great
light on my issue.
Essentially it's this:-
I have an Actvity (in my case an audit of beach safety) which is linked
to a beach and is a long transaction (that is it can take weeks).
what I want to do is ensure that when a new audit is entered it cant
include a beach that is already subject to an open audit.
I've built an insert form that makes this easy but it is still possible
for a user to create a new audit by using the back arrow and
resubmitting the existing data.
I can solve this issue with program logic, but I'm more concerned to
have the object deal with it, at least then I can use the same technique
for any other object.
Oh, and on another issue, if I have a linked object (eg Employee -
Dept)
how do I reference Dept details within the Employee object after a
get_link() ?
for example
emp = new DataObject_Employee;
emp->get(123);
emp->get_links();
print ($emp->dept->deptName); ??? - I tried thi sonce and failed and
could figure it out
Thanks
Barry
--
Barry Steele <barry@hpfm.biz>
hpfm