Login | Register
My pages Projects Community openCollabNet

Discussions > users > [propel] Adding Class Typing to Objects

propel
Discussion topic

Back to topic list

[propel] Adding Class Typing to Objects

Reply

Author matthewh
Full name Matthew Hershberger
Date 2004-04-13 06:40:00 PDT
Message Hello all,

What are the lists thoughts on adding typing to the php5 functions so
errors related to passing the wrong object type are more expressive?
function getId((Role) $v) instead of function getId($v). Would that be
hard to do?

Thanks,

Matt

On Apr 13, 2004, at 09:14, Hans Lellelid wrote:

> Hi Denny,
>
>> I'm trying to get my many-to-many mojo working
>> but it just ain't happenin', my friends.
>>
>> I have User, Role, and UserRoleRef tables.
>> I'd like to select all users with a given role.
>
> Well, I'm not sure exactly how your tables are laid out. I'm assuming
> you
> have a role_id and a user_id in the reference table. If you know the
> role_id, then here's how you should be able to do this:
>
> $c = new Criteria();
> $c->add(UserRole​RefPeer::ROLE_ID, $id_of_role);
>
> $users = UserPeer::doSelectJo​inUserRoleRef($c);
>
> ... something like that should work. Check the method names, etc. --
> it's
> early here & I'm still waking up :)
>
> I'm not entirely sure you even need to use that doSelect method,
> though.
> I think it will also work to simply do:
>
> $users = UserPeer::doSelect($c);
>
> since you don't actually need the joined rows from the cross-reference
> table.
>
> Does this help at all? (Feel free to also send me privately your
> schema
> if you'd like me to help out.)
>
> Hans
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: users-unsubscribe@pr​opel.tigris.org
> For additional commands, e-mail: users-help at propel dot tigris dot org
>
>


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: users-unsubscribe@pr​opel.tigris.org
For additional commands, e-mail: users-help at propel dot tigris dot org

« Previous message in topic | 3 of 4 | Next message in topic »

Messages

Show all messages in topic

[propel] even MORE on many-to-many (now for the UNBELIEVABLE price of $5.99!) "Denny H dot Shimkoski" <dhs at hamfish dot org> "Denny H dot Shimkoski" <dhs at hamfish dot org> 2004-04-13 05:50:34 PDT
     Re: [propel] even MORE on many-to-many (now for the UNBELIEVABLE price of $5.99!) hlellelid Hans Lellelid 2004-04-13 06:14:34 PDT
         [propel] Adding Class Typing to Objects matthewh Matthew Hershberger 2004-04-13 06:40:00 PDT
             Re: [propel] Adding Class Typing to Objects hlellelid Hans Lellelid 2004-04-13 06:49:27 PDT
Messages per page: