Completed
Push — master ( 8c15b3...f8d4b2 )
by Arman
15s queued 11s
created

ModelException::undefinedMethod()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.9.9
13
 */
14
15
namespace Quantum\Model\Exceptions;
16
17
use Quantum\Model\Enums\ExceptionMessages;
18
use Quantum\App\Exceptions\BaseException;
19
20
/**
21
 * Class ModelException
22
 * @package Quantum\Model
23
 */
24
class ModelException extends BaseException
25
{
26
27
    /**
28
     * @param string $name
29
     * @return ModelException
30
     */
31
    public static function inappropriateProperty(string $name): ModelException
32
    {
33
        return new static(_message(ExceptionMessages::INAPPROPRIATE_MODEL_PROPERTY, $name), E_WARNING);
34
    }
35
36
    /**
37
     * @param string $modelName
38
     * @param string $tableName
39
     * @return ModelException
40
     */
41
    public static function wrongRelation(string $modelName, string $tableName): ModelException
42
    {
43
        return new static(_message(ExceptionMessages::WRONG_RELATION, [$modelName, $tableName]), E_ERROR);
44
    }
45
}
46