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

Added support for optimalized relations loading. #16

Open
wants to merge 3 commits into
base: v3.0
Choose a base branch
from

Conversation

Unlink
Copy link
Contributor

@Unlink Unlink commented Nov 9, 2023

Pridaná podpora pre naťahovanie relácii.
Príklad, DDL a triedy Post a User: https://gist.github.com/Unlink/d74fb61fa8bb1e971f84406a358a0cb1

$posts = Post::getAll();
foreach ($posts as $post) {
    echo $post->getOneRelated(User::class)->getFullName();
}

        
$users = User::getAll();
foreach ($users as $user) {
    echo count($user->getAllRelated(Post::class, where: "visibility = 'public'"));
}

@Unlink Unlink added this to the v3.0 milestone Nov 9, 2023
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.

1 participant