protected function unsetInvalidBlames($guids)
    {
        $unchecked = $guids;
        $multiBlamesClass = $this->multiBlamesClass;
        $mbi = $multiBlamesClass::buildNoInitModel();
        foreach ($guids as $key => $guid) {
            $blame = $multiBlamesClass::find()->where([$mbi->guidAttribute => $guid])->exists();
            if (!$blame) {
                unset($guids[$key]);
            }
        }
        $diff = array_diff($unchecked, $guids);
        $eventName = static::$eventMultipleBlamesChanged;
        $this->trigger($eventName, new MultipleBlameableEvent(['blamesChanged' => !empty($diff)]));
        return $guids;
    }
protected function unsetInvalidBlames($guids)
    {
        $unchecked = $guids;
        $multiBlamesClass = $this->multiBlamesClass;
        $mbi = $multiBlamesClass::buildNoInitModel();
        foreach ($guids as $key => $guid) {
            $blame = $multiBlamesClass::find()->where([$mbi->guidAttribute => $guid])->exists();
            if (!$blame) {
                unset($guids[$key]);
            }
        }
        $diff = array_diff($unchecked, $guids);
        $eventName = static::$eventMultipleBlamesChanged;
        $this->trigger($eventName, new MultipleBlameableEvent(['blamesChanged' => !empty($diff)]));
        return $guids;
    }
protected function unsetInvalidBlames ( $ guids ) { $ unchecked = $ guids ; $ multiBlamesClass = $ this -> multiBlamesClass ; $ mbi = $ multiBlamesClass :: buildNoInitModel ( ) ; foreach ( $ guids as $ key => $ guid ) { $ blame = $ multiBlamesClass :: find ( ) -> where ( [ $ mbi -> guidAttribute => $ guid ] ) -> exists ( ) ; if ( ! $ blame ) { unset ( $ guids [ $ key ] ) ; } } $ diff = array_diff ( $ unchecked , $ guids ) ; $ eventName = static :: $ eventMultipleBlamesChanged ; $ this -> trigger ( $ eventName , new MultipleBlameableEvent ( [ 'blamesChanged' => ! empty ( $ diff ) ] ) ) ; return $ guids ; }
Remove invalid blame guid from provided guid array.
@param array $guids guid array of blames.
@return array guid array of blames unset invalid.
Remove invalid blame guid from provided guid array .