Exemple #1
0
 public static function relations(MapperInterface $mapper, EntityInterface $entity)
 {
     return ['posts' => $mapper->hasManyThrough($entity, 'SpotTest\\Entity\\Post', 'SpotTest\\Entity\\PostTag', 'tag_id', 'post_id')];
 }
Exemple #2
0
 public static function relations(\Spot\MapperInterface $mapper, \Spot\EntityInterface $entity)
 {
     return ['users' => $mapper->hasManyThrough($entity, 'OpenCFP\\Domain\\Entity\\User', 'OpenCFP\\Domain\\Entity\\UserGroup', 'user_id', 'group_id')];
 }
Exemple #3
0
 public static function relations(MapperInterface $mapper, EntityInterface $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']), 'polymorphic_comments' => $mapper->hasMany($entity, 'SpotTest\\Entity\\PolymorphicComment', 'item_id')->where(['item_type' => 'post']), 'author' => $mapper->belongsTo($entity, 'SpotTest\\Entity\\Author', 'author_id')];
 }
Exemple #4
0
 public static function relations(\Spot\MapperInterface $mapper, \Spot\EntityInterface $entity)
 {
     return ['talks' => $mapper->hasMany($entity, \OpenCFP\Domain\Entity\Talk::class, 'user_id'), 'groups' => $mapper->hasManyThrough($entity, \OpenCFP\Domain\Entity\Group::class, \OpenCFP\Domain\Entity\UserGroup::class, 'group_id', 'user_id'), 'comments' => $mapper->hasMany($entity, \OpenCFP\Domain\Entity\TalkComment::class, 'user_id')];
 }
Exemple #5
0
 public static function relations(\Spot\MapperInterface $mapper, \Spot\EntityInterface $entity)
 {
     return ['talks' => $mapper->hasMany($entity, 'OpenCFP\\Domain\\Entity\\Talk', 'user_id'), 'groups' => $mapper->hasManyThrough($entity, 'OpenCFP\\Domain\\Entity\\Group', '\\OpenCFP\\Domain\\Entity\\UserGroup', 'group_id', 'user_id'), 'comments' => $mapper->hasMany($entity, 'OpenCFP\\Domain\\Entity\\TalkComment', 'user_id')];
 }