OneToMany::createAssociation()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 1
Metric Value
c 2
b 0
f 1
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 3
crap 1
1
<?php
2
3
namespace LaravelDoctrine\Fluent\Relations;
4
5
use Doctrine\ORM\Mapping\Builder\ClassMetadataBuilder;
6
use Doctrine\ORM\Mapping\Builder\OneToManyAssociationBuilder;
7
use LaravelDoctrine\Fluent\Relations\Traits\Indexable;
8
use LaravelDoctrine\Fluent\Relations\Traits\Orderable;
9
use LaravelDoctrine\Fluent\Relations\Traits\Ownable;
10
11
/**
12
 * @method $this mappedBy($fieldName)
13
 */
14
class OneToMany extends AbstractRelation
15
{
16
    use Ownable, Orderable, Indexable;
17
18
    /**
19
     * @var OneToManyAssociationBuilder
20
     */
21
    protected $association;
22
23
    /**
24
     * @param ClassMetadataBuilder $builder
25
     * @param string               $relation
26
     * @param string               $entity
27
     *
28
     * @return OneToManyAssociationBuilder
29
     */
30 24
    protected function createAssociation(ClassMetadataBuilder $builder, $relation, $entity)
31
    {
32 24
        return $this->builder->createOneToMany($relation, $entity);
33
    }
34
}
35