Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayObject relations #425

Open
wants to merge 9 commits into
base: 1.2-dev
Choose a base branch
from
Open

Conversation

koenpunt
Copy link
Collaborator

This is updated version of @greut's PR #108, which fixes #49.

His original description below:


A relation returns an object instead of an Array that enables better usage of count.

$host->venues // does nothing
count($host->venues) // select count(*) … where $host_id = ?
$host->venues[0] // select … inner join …

It could even lead to some improvements, feature wise:

$venues = $host->venues(array('is_active' => true));
count($venues) // select count(*) … where $host_id = ? and is_active = 1
$venues[0] // select … inner join … where is_active = 1

This still need to be done, but I'd like to see something like that implemented.

@koenpunt koenpunt changed the title Greut arrayobject relations ArrayObject relations Jul 17, 2014
@koenpunt
Copy link
Collaborator Author

This is in need of some revision and coding style updates though.

@koenpunt koenpunt mentioned this pull request Jul 17, 2014
@koenpunt koenpunt force-pushed the greut-arrayobject-relations branch 2 times, most recently from e90f322 to 44d2602 Compare November 17, 2014 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants