PHP Class Bravo3\Orm\Drivers\Common\Ref

Show file Open project: bravo3/orm Class Usage Examples

Protected Properties

Property Type Description
$entity_id string
$relationship_name string
$source_class string TODO: Storing the class name in the database is a terrible idea. Ideally this needs to be a table name, however the ability to dereference a Ref requires class meta-data. This WILL be changed at some point.

Public Methods

Method Description
__construct ( string $source_class, string $entity_id, string $relationship_name ) Create an inverse reference to an entity
__toString ( ) : string Get the ref in string form
fromString ( string $ref ) : Ref Create a ref from a string interpretation
getEntityId ( ) : string Get EntityId
getRelationshipName ( ) : string Get RelationshipName
getSourceClass ( ) : string Get SourceClass
setEntityId ( string $entity_id ) Set EntityId
setRelationshipName ( string $relationship_name ) Set RelationshipName
setSourceClass ( string $source_class ) Set SourceClass

Method Details

__construct() public method

Create an inverse reference to an entity
public __construct ( string $source_class, string $entity_id, string $relationship_name )
$source_class string
$entity_id string
$relationship_name string

__toString() public method

Get the ref in string form
public __toString ( ) : string
return string

fromString() public static method

Create a ref from a string interpretation
public static fromString ( string $ref ) : Ref
$ref string
return Ref

getEntityId() public method

Get EntityId
public getEntityId ( ) : string
return string

getRelationshipName() public method

Get RelationshipName
public getRelationshipName ( ) : string
return string

getSourceClass() public method

Get SourceClass
public getSourceClass ( ) : string
return string

setEntityId() public method

Set EntityId
public setEntityId ( string $entity_id )
$entity_id string

setRelationshipName() public method

Set RelationshipName
public setRelationshipName ( string $relationship_name )
$relationship_name string

setSourceClass() public method

Set SourceClass
public setSourceClass ( string $source_class )
$source_class string

Property Details

$entity_id protected property

protected string $entity_id
return string

$relationship_name protected property

protected string $relationship_name
return string

$source_class protected property

TODO: Storing the class name in the database is a terrible idea. Ideally this needs to be a table name, however the ability to dereference a Ref requires class meta-data. This WILL be changed at some point.
protected string $source_class
return string