Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.07 KB

Signer.md

File metadata and controls

42 lines (33 loc) · 1.07 KB

Signer Structure

⬆ back to readme

The signer structure is used to add a signer. Before add a signer you need to create it from the array parameters with the static function Signer::createFromArray().

Here is an example:

...
use Mpp\UniversignBundle\Requester\SignerInterface;

...
/**
 * @var SignerInterface;
 */
private $requester;

public function __construct(SignerInterface $requester)
{
    $this->requester = $requester;
}

...
    $transaction = $this->requester->initiateTransaction();

    $signer = Signer::createFromArray([
        'firstname' => 'john',
        'lastname' => 'doe',
        'organization' => 'dummy company',
        'emailAddress' => '[email protected]',
        'phoneNum' => '+0122334455',
        'language' => 'fr',
        'role' => \Mpp\UniversignBundle\Model\Signer::ROLE_SIGNER,
        'birthDate' => new \DateTime::createFromFormat('Y-m-d', '2000-01-01'),
        'certificateType' =>  \Mpp\UniversignBundle\Model\CertificateType::SIMPLE,
    ]);

    $transaction->addSigner($signer);