public static function getAttachmentsForProspect($nb_prospect)
    {
        if (is_numeric($nb_prospect_id = nb_getMixedValue($nb_prospect, NABU_ICONTACT_PROSPECT_FIELD_ID))) {
            $retval = CNabuIContactProspectAttachment::buildObjectListFromSQL(
                NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID,
                'SELECT ipa.*
                   FROM nb_icontact_prospect_attachment ipa, nb_icontact_prospect ip
                  WHERE ipa.nb_icontact_prospect_id=ip.nb_icontact_prospect_id
                    AND ip.nb_icontact_prospect_id=%prospect_id$d
                  ORDER BY ipa.nb_icontact_prospect_attachment_id',
                array(
                    'prospect_id' => $nb_prospect_id
                ),
                ($nb_prospect instanceof CNabuIContactProspect ? $nb_prospect : null)
            );

            if ($nb_prospect instanceof CNabuIContactProspect) {
                $retval->iterate(
                    function($key, CNabuIContactProspectAttachment $nb_attachment) use ($nb_prospect)
                    {
                        $nb_attachment->setIContactProspect($nb_prospect);
                        return true;
                    }
                );
            }
        } else {
            $retval = new CNabuIContactProspectList(($nb_prospect instanceof CNabuIContactProspect ? $nb_prospect : null));
        }

        return $retval;
    }
public static function getAttachmentsForProspect($nb_prospect)
    {
        if (is_numeric($nb_prospect_id = nb_getMixedValue($nb_prospect, NABU_ICONTACT_PROSPECT_FIELD_ID))) {
            $retval = CNabuIContactProspectAttachment::buildObjectListFromSQL(
                NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID,
                'SELECT ipa.*
                   FROM nb_icontact_prospect_attachment ipa, nb_icontact_prospect ip
                  WHERE ipa.nb_icontact_prospect_id=ip.nb_icontact_prospect_id
                    AND ip.nb_icontact_prospect_id=%prospect_id$d
                  ORDER BY ipa.nb_icontact_prospect_attachment_id',
                array(
                    'prospect_id' => $nb_prospect_id
                ),
                ($nb_prospect instanceof CNabuIContactProspect ? $nb_prospect : null)
            );

            if ($nb_prospect instanceof CNabuIContactProspect) {
                $retval->iterate(
                    function($key, CNabuIContactProspectAttachment $nb_attachment) use ($nb_prospect)
                    {
                        $nb_attachment->setIContactProspect($nb_prospect);
                        return true;
                    }
                );
            }
        } else {
            $retval = new CNabuIContactProspectList(($nb_prospect instanceof CNabuIContactProspect ? $nb_prospect : null));
        }

        return $retval;
    }
public static function getAttachmentsForProspect ( $ nb_prospect ) { if ( is_numeric ( $ nb_prospect_id = nb_getMixedValue ( $ nb_prospect , NABU_ICONTACT_PROSPECT_FIELD_ID ) ) ) { $ retval = CNabuIContactProspectAttachment :: buildObjectListFromSQL ( NABU_ICONTACT_PROSPECT_ATTACHMENT_FIELD_ID , 'SELECT ipa.*
                   FROM nb_icontact_prospect_attachment ipa, nb_icontact_prospect ip
                  WHERE ipa.nb_icontact_prospect_id=ip.nb_icontact_prospect_id
                    AND ip.nb_icontact_prospect_id=%prospect_id$d
                  ORDER BY ipa.nb_icontact_prospect_attachment_id' , array ( 'prospect_id' => $ nb_prospect_id ) , ( $ nb_prospect instanceof CNabuIContactProspect ? $ nb_prospect : null ) ) ; if ( $ nb_prospect instanceof CNabuIContactProspect ) { $ retval -> iterate ( function ( $ key , CNabuIContactProspectAttachment $ nb_attachment ) use ( $ nb_prospect ) { $ nb_attachment -> setIContactProspect ( $ nb_prospect ) ; return true ; } ) ; } } else { $ retval = new CNabuIContactProspectList ( ( $ nb_prospect instanceof CNabuIContactProspect ? $ nb_prospect : null ) ) ; } return $ retval ; }
Get a list of all attachments associated to an iContact Prospect instance.
@param mixed $nb_prospect A CNabuDataObject containing a field named nb_icontact_prospect_id or a valid Id.
@return CNabuIContactProspectAttachmentList Returns the list with found attachments.
Get a list of all attachments associated to an iContact Prospect instance .