Overview

Namespaces

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

Classes

  • AttachmentEntity
  • ContactEntity
  • ContactListEntity
  • ContactQueueEntity
  • DomainEntity
  • GenericEntity
  • MessageEntity
  • RecipientEntity
  • Overview
  • Namespace
  • Class

Class GenericEntity

Generic entity class

Direct known subclasses

Crunchmail\Entities\AttachmentEntity, Crunchmail\Entities\ContactEntity, Crunchmail\Entities\ContactListEntity, Crunchmail\Entities\ContactQueueEntity, Crunchmail\Entities\DomainEntity, Crunchmail\Entities\MessageEntity, Crunchmail\Entities\RecipientEntity
Namespace: Crunchmail\Entities
Located at Entities/GenericEntity.php
Methods summary
public Crunchmail\Entity\GenericEntity
# __construct( Crunchmail\Resources\GenericResource $resource, stdClass $data )

Create a new entity

Create a new entity

Parameters

$resource
caller resource
$data
entity data

Returns

Crunchmail\Entity\GenericEntity
public string
# __toString( )

Generic conversion to string

Generic conversion to string

Returns

string
public stdClass
# getBody( )

Return Entity body

Return Entity body

Returns

stdClass
public Crunchmail\Entity\GenericEntity
# __call( string $method, array $args )

Catch get, post, put… methods

Catch get, post, put… methods

Parameters

$method
$name method name
$args
arguments

Returns

Crunchmail\Entity\GenericEntity
public mixed
# __get( string $name )

Access entity or resources with object properties

Access entity or resources with object properties

Note that this technic could lead to conflict if a resource and a body field have the same name

Ex: echo $message->title $arr = $message->recipients->current();

Parameters

$name
resource name

Returns

mixed
resource
public boolean
# __isset( string $key )

Allow use of isset on _body fields

Allow use of isset on _body fields

Parameters

$key
key to check

Returns

boolean
public boolean
# __unset( string $key )

Allow use of isset on _body fields

Allow use of isset on _body fields

Parameters

$key
key to check

Returns

boolean
public string
# getLink( string $name )

Get the content of the links attribute, mapping the name first

Get the content of the links attribute, mapping the name first

Parameters

$name
name of the field

Returns

string
Properties summary
protected object $_resource

Caller resource

Caller resource

#
protected stdClass $_body

Entity body

Entity body

#
protected static array $exposeLinks
# []
protected static array $links

Links remapping

Links remapping

# [ 'recipients' => 'mails' ]
protected static array $resources

Resource mapping

Resource mapping

# []
API documentation generated by ApiGen