hasMany() public method

Relation: HasMany
public hasMany ( EntityInterface $entity, $entityName, $foreignKey, $localValue = null )
$entity EntityInterface
Example #1
0
 public static function relations(Mapper $mapper, Entity $entity)
 {
     return ['tags' => $mapper->hasManyThrough($entity, 'SpotTest\\Entity\\Tag', 'SpotTest\\Entity\\PostTag', 'tag_id', 'post_id'), 'comments' => $mapper->hasMany($entity, 'SpotTest\\Entity\\Post\\Comment', 'post_id')->order(['date_created' => 'ASC']), 'author' => $mapper->belongsTo($entity, 'SpotTest\\Entity\\Author', 'author_id')];
 }