phalcon / phalcon/cphalcon

[NFR]: Can we have condition for parent model in belongsTo

Open
#17,333 0 comments 0 reactions 1 assignee View on GitHub

@niden is already working on this.

Since Apr 10, 2021.

7.0 new feature request
Dominant language
PHP
Stars
10.8k
Forks
1.9k
Avg merge
7h 2m
Merged PRs (30d)
47

Description

So I have a DB doc_submitted which has two columns doc_type and doc_id where doc_type can refer to any table viz: assignment or task or book and doc_id will have respective id.

Now I want to write relationship in the DocSubmitted Model so I can refer them in view as doc_submitted.Assignment.topic or doc_submitted.Task.date.

If I'm putting the condition it's always searching in reference model instead of parent model.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.