using ActiveQuery::Exists() method in friendly mode#302
Conversation
|
Thanks for contribution but this shortcut doesn't look alright:
Therefore decision is not to accept the pull request. |
|
@samdark thanks. my goals of writing this method is a simple and efficient programming.
no. it is based on-demand. when you set parameter 2 then
this is main goal. by this feature if you set then you get.
please see this example: $myUserForDelete = User::find()->where([...])->one();
if(!$myUserForDelete)
return 'error';
$myUserForDelete->Delete();
or
#low code
#better understanding
if(!User::Exists([...],$myUserForDelete))
return 'error';
$myUserForDelete->Delete();
only php side. |
Yes, that's what I mean. It does two things and that is not good. |
|
thanks for comment. |
example (fetch document from database)
example (no fetch document from database)
this PR is efficient when that PR committed.