src/Charcoal/Admin/Script/Notification/AbstractNotificationScript.php
private function handleNotification(Notification $notification)
    {
        if (empty($notification->targetTypes())) {
            return;
        }
        $objectsByTypes = [];
        $numTotal = 0;
        foreach ($notification->targetTypes() as $objType) {
            $objType = trim($objType);
            $objects = $this->updatedObjects($objType);
            $num = count($objects);
            if ($num == 0) {
                continue;
            }
            $obj = [];
            $obj['objects'] = $objects;
            $obj['num'] = $num;
            $obj['type'] = $objType;
            $obj['typeLabel'] = isset($objects[0]['targetTypeLabel']) ? $objects[0]['targetTypeLabel'] : $objType;

            $objectsByTypes[$objType] = $obj;
            $numTotal += $num;
        }
        $this->sendEmail($notification, $objectsByTypes, $numTotal);
    }
private function handleNotification(Notification $notification)
    {
        if (empty($notification->targetTypes())) {
            return;
        }
        $objectsByTypes = [];
        $numTotal = 0;
        foreach ($notification->targetTypes() as $objType) {
            $objType = trim($objType);
            $objects = $this->updatedObjects($objType);
            $num = count($objects);
            if ($num == 0) {
                continue;
            }
            $obj = [];
            $obj['objects'] = $objects;
            $obj['num'] = $num;
            $obj['type'] = $objType;
            $obj['typeLabel'] = isset($objects[0]['targetTypeLabel']) ? $objects[0]['targetTypeLabel'] : $objType;

            $objectsByTypes[$objType] = $obj;
            $numTotal += $num;
        }
        $this->sendEmail($notification, $objectsByTypes, $numTotal);
    }
private function handleNotification ( Notification $ notification ) { if ( empty ( $ notification -> targetTypes ( ) ) ) { return ; } $ objectsByTypes = [ ] ; $ numTotal = 0 ; foreach ( $ notification -> targetTypes ( ) as $ objType ) { $ objType = trim ( $ objType ) ; $ objects = $ this -> updatedObjects ( $ objType ) ; $ num = count ( $ objects ) ; if ( $ num == 0 ) { continue ; } $ obj = [ ] ; $ obj [ 'objects' ] = $ objects ; $ obj [ 'num' ] = $ num ; $ obj [ 'type' ] = $ objType ; $ obj [ 'typeLabel' ] = isset ( $ objects [ 0 ] [ 'targetTypeLabel' ] ) ? $ objects [ 0 ] [ 'targetTypeLabel' ] : $ objType ; $ objectsByTypes [ $ objType ] = $ obj ; $ numTotal += $ num ; } $ this -> sendEmail ( $ notification , $ objectsByTypes , $ numTotal ) ; }
Handle a notification request

@param Notification $notification The notification object to handle.
@return void
Handle a notification request