/** * Remove invalid blame guid from provided guid array. * @param array $guids guid array of blames. * @return array guid array of blames unset invalid. */ protected function unsetInvalidBlames($guids) { $checkedGuids = Number::unsetInvalidUuids($guids); $multiBlamesClass = $this->multiBlamesClass; foreach ($checkedGuids as $key => $guid) { $blame = $multiBlamesClass::findOne($guid); if (!$blame) { unset($checkedGuids[$key]); } } $diff = array_diff($guids, $checkedGuids); $eventName = static::$eventMultipleBlamesChanged; $this->trigger($eventName, new MultipleBlameableEvent(['blamesChanged' => !empty($diff)])); return $checkedGuids; }