public function attachMosaic($mosaic, $quantity = null)
    {
        $attachment = $this->prepareAttachment($mosaic);
        $actualAmt  = $attachment->quantity ?: $quantity ?: 0;
        $attachment->setAttribute("quantity", $actualAmt);

        // push to internal storage
        $attachments = $this->getAttribute("mosaics") ?: [];
        array_push($attachments, $attachment);

        $this->setAttribute("mosaics", $attachments);
        return $this;
    }
public function attachMosaic($mosaic, $quantity = null)
    {
        $attachment = $this->prepareAttachment($mosaic);
        $actualAmt  = $attachment->quantity ?: $quantity ?: 0;
        $attachment->setAttribute("quantity", $actualAmt);

        // push to internal storage
        $attachments = $this->getAttribute("mosaics") ?: [];
        array_push($attachments, $attachment);

        $this->setAttribute("mosaics", $attachments);
        return $this;
    }
public function attachMosaic ( $ mosaic , $ quantity = null ) { $ attachment = $ this -> prepareAttachment ( $ mosaic ) ; $ actualAmt = $ attachment -> quantity ? : $ quantity ? : 0 ; $ attachment -> setAttribute ( "quantity" , $ actualAmt ) ; // push to internal storage $ attachments = $ this -> getAttribute ( "mosaics" ) ? : [ ] ; array_push ( $ attachments , $ attachment ) ; $ this -> setAttribute ( "mosaics" , $ attachments ) ; return $ this ; }
Helper to easily attach mosaics to the attachments.

@param   string|\NEM\Models\Mosaic|\NEM\Models\MosaicAttachment  $mosaic
@param   null|integer                                            $quantity
@return \NEM\Models\Transaction\MosaicTransfer
Helper to easily attach mosaics to the attachments .