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

HasOneSql::addField(): Use type from reference Model #880

Merged

Conversation

PhilippGrashoff
Copy link
Contributor

Hello,

currently, the type of a field is not taken from the referenced model (unlike Caption, this is already pulled from the referenced Model). This leads to:

//in ModelA
$this->addField('some_date', ['type' => 'date']);

//in ModelB
$this->hasOne('model_a_id', ['model' => [ModelA::class]]);
$this->getRef('model_a_id')->addField('some_date');

at this point, ModelBs field 'some_date' is of type string, not of type date as defined in ModelA. This PR would change this.

@PhilippGrashoff PhilippGrashoff force-pushed the feature/hasOneUseTypeFromReferenceModel branch from 97e1c8d to 1363857 Compare May 28, 2021 14:23
@PhilippGrashoff
Copy link
Contributor Author

RTM, can't assign labels

@PhilippGrashoff PhilippGrashoff marked this pull request as ready for review July 12, 2021 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants