Owning::owns()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1
Metric Value
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
3
namespace LaravelDoctrine\Fluent\Relations\Traits;
4
5
trait Owning
6
{
7
    /**
8
     * @param string $relation
9
     *
10
     * @return $this
11
     */
12 5
    public function owns($relation)
13
    {
14 5
        $this->getAssociation()->inversedBy($relation);
15
16 5
        return $this;
17
    }
18
19
    /**
20
     * @return \Doctrine\ORM\Mapping\Builder\AssociationBuilder
21
     */
22
    abstract public function getAssociation();
23
}
24