summaryrefslogtreecommitdiffstats
path: root/vendor/ipl/orm/src/Contract/RewritePathBehavior.php
blob: b5b0385b03c27252f98892c62b59ec0df5ae5bcf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<?php

namespace ipl\Orm\Contract;

use ipl\Orm\Behavior;

interface RewritePathBehavior extends Behavior
{
    /**
     * Rewrite the given relation path
     *
     * The result must be returned otherwise (NULL is returned) the original path is kept as is.
     *
     * @param string $path
     * @param ?string $relation The absolute path of the model. For reference only, don't include it in the result
     *
     * @return ?string
     */
    public function rewritePath(string $path, ?string $relation = null): ?string;
}