I have an array of objects extracted from a database:
$masterListContacts = MasterListContacts::find() ->select('master_list_contacts.*') ->innerJoin('master_contacts', '`master_contacts`.`id` = `master_list_contacts`.`master_contact_id`') ->with('masterContact') ->where(['user_id' => \Yii::$app->user->identity->id, 'slug' => $slug]) ->all();
Under certain circumstances, I need to delete all rows from the database represented in this array. But with the delete () and deleteAll () methods, I got a Call to a member function ... on array error. Can someone please tell me which one is the best way to achieve this.
UPDATE: Here is my database structure.
source share