Overview

Namespaces

  • Crunchmail
    • Collections
    • Entities
    • Exception
    • PHPUnit
    • Resources

Classes

  • Crunchmail\Client
  • Crunchmail\Collections\GenericCollection
  • Crunchmail\Entities\AttachmentEntity
  • Crunchmail\Entities\ContactEntity
  • Crunchmail\Entities\ContactListEntity
  • Crunchmail\Entities\ContactQueueEntity
  • Crunchmail\Entities\DomainEntity
  • Crunchmail\Entities\GenericEntity
  • Crunchmail\Entities\MessageEntity
  • Crunchmail\Entities\RecipientEntity
  • Crunchmail\PHPUnit\IsEntityConstraint
  • Crunchmail\PHPUnit\IsGenericCollectionConstraint
  • Crunchmail\PHPUnit\IsGenericEntityConstraint
  • Crunchmail\PHPUnit\IsGenericResourceConstraint
  • Crunchmail\PHPUnit\IsResourceConstraint
  • Crunchmail\PHPUnit\TestCase
  • Crunchmail\Resources\DomainsResource
  • Crunchmail\Resources\GenericResource
  • Crunchmail\Resources\PreviewSendResource

Exceptions

  • Crunchmail\Exception\ApiException
  • Overview
  • Namespace
  • Class
 1: <?php
 2: /**
 3:  * Contact entity
 4:  *
 5:  * @author    Yannick Huerre <dev@sheoak.fr>
 6:  * @copyright 2015 (c) Oasiswork
 7:  * @license   https://opensource.org/licenses/MIT MIT
 8:  */
 9: namespace Crunchmail\Entities;
10: 
11: /**
12:  * Message entity class
13:  */
14: class ContactEntity extends \Crunchmail\Entities\GenericEntity
15: {
16:     /**
17:      * To string
18:      *
19:      * @return string
20:      */
21:     public function __toString()
22:     {
23:         return $this->name;
24:     }
25: 
26:     /**
27:      * Copy contact to another list
28:      *
29:      * @param ContactListEntity $list List where to copy
30:      *
31:      * @return ContactEntity
32:      */
33:     public function copyTo($list)
34:     {
35:         $body = $this->getBody();
36: 
37:         unset($body->url);
38:         $body->contact_list = $list->url;
39: 
40:         return $this->_resource->client->contacts->post($body);
41:     }
42: }
43: 
API documentation generated by ApiGen