Login | Register
My pages Projects Community openCollabNet

Discussions > users > [propel] even MORE on many-to-many (now for the UNBELIEVABLE price of $5.99!)

propel
Discussion topic

Hide all messages in topic

All messages in topic

Re: [propel] Adding Class Typing to Objects

Reply

Author hlellelid
Full name Hans Lellelid
Date 2004-04-13 06:49:27 PDT
Message Hi Matt,

> 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?

In general adding class hints should be fine. I'm not sure specifically
which method you mean here. (Did you mean function setRole(Role $v) ?)

I think for the foreign key related objects adding type hints would make
sense -- maybe save some pain for some people.

I have a mild concern about over-using typehints for performance purposes,
but have absolutely no benchmarks to suggest that type hints actually do
pose a significant performance hit. I guess less of a concern than a
consideration.

Hans

P.S. I think relatively few of the people who have been involved in
development are subscribed to the users@ list, so I'm cross-posting this
to the dev@ list also.

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

[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

Re: [propel] even MORE on many-to-many (now for the UNBELIEVABLE price of $5.99!)

Reply

Author hlellelid
Full name Hans Lellelid
Date 2004-04-13 06:14:34 PDT
Message 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

[propel] even MORE on many-to-many (now for the UNBELIEVABLE price of $5.99!)

Reply

Author "Denny H dot Shimkoski" <dhs at hamfish dot org>
Full name "Denny H dot Shimkoski" <dhs at hamfish dot org>
Date 2004-04-13 05:50:34 PDT
Message Top o' the mornin' everyone (in the EST zone)!

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.

How to accomplish this most magical feat?

Thanks,
Denny

"...So this zen buddhist walks up to the hot dog vendor
 and says, 'Make me one with everything!'"

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