src/Recipient/RecipientFactory.php
public static function createProcessedContactFromStdClass(\stdClass $stdContact): ProcessedContact
    {
        if (empty($stdContact->FirstName)) {
            throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute");
        }
        if (empty($stdContact->Phone)) {
            throw new \InvalidArgumentException("stdClass argument must contain Phone attribute");
        }
        $contact = new ProcessedContact(
            $stdContact->FirstName,
            $stdContact->Phone,
            $stdContact->ID,
            $stdContact->OwnerID,
            $stdContact->LastName ?? null,
            $stdContact->Title ?? null,
            $stdContact->Organization ?? null,
            $stdContact->Email ?? null,
            $stdContact->Notes ?? null,
            isset($stdContact->Created) ? new \DateTime($stdContact->Created, new \DateTimeZone("UTC")) : null,
            isset($stdContact->Modified) ? new \DateTime($stdContact->Modified, new \DateTimeZone("UTC")) : null
        );
        return $contact;
    }
public static function createProcessedContactFromStdClass(\stdClass $stdContact): ProcessedContact
    {
        if (empty($stdContact->FirstName)) {
            throw new \InvalidArgumentException("stdClass argument must contain FirstName attribute");
        }
        if (empty($stdContact->Phone)) {
            throw new \InvalidArgumentException("stdClass argument must contain Phone attribute");
        }
        $contact = new ProcessedContact(
            $stdContact->FirstName,
            $stdContact->Phone,
            $stdContact->ID,
            $stdContact->OwnerID,
            $stdContact->LastName ?? null,
            $stdContact->Title ?? null,
            $stdContact->Organization ?? null,
            $stdContact->Email ?? null,
            $stdContact->Notes ?? null,
            isset($stdContact->Created) ? new \DateTime($stdContact->Created, new \DateTimeZone("UTC")) : null,
            isset($stdContact->Modified) ? new \DateTime($stdContact->Modified, new \DateTimeZone("UTC")) : null
        );
        return $contact;
    }
public static function createProcessedContactFromStdClass ( \ stdClass $ stdContact ) : ProcessedContact { if ( empty ( $ stdContact -> FirstName ) ) { throw new \ InvalidArgumentException ( "stdClass argument must contain FirstName attribute" ) ; } if ( empty ( $ stdContact -> Phone ) ) { throw new \ InvalidArgumentException ( "stdClass argument must contain Phone attribute" ) ; } $ contact = new ProcessedContact ( $ stdContact -> FirstName , $ stdContact -> Phone , $ stdContact -> ID , $ stdContact -> OwnerID , $ stdContact -> LastName ?? null , $ stdContact -> Title ?? null , $ stdContact -> Organization ?? null , $ stdContact -> Email ?? null , $ stdContact -> Notes ?? null , isset ( $ stdContact -> Created ) ? new \ DateTime ( $ stdContact -> Created , new \ DateTimeZone ( "UTC" ) ) : null , isset ( $ stdContact -> Modified ) ? new \ DateTime ( $ stdContact -> Modified , new \ DateTimeZone ( "UTC" ) ) : null ) ; return $ contact ; }
Creates a ProcessedContact using the stdClass given.
@param \stdClass $stdContact An stdClass object matching the format of the IP1 SMS API.
@return ProcessedContact
@throws \InvalidArgumentException Thrown when required parameters in the argument is missing.
Creates a ProcessedContact using the stdClass given .