Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
CRAP
100.00% covered (success)
100.00%
1 / 1
AuditableModel
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
4 / 4
4
100.00% covered (success)
100.00%
1 / 1
 setAuditor
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 getAuditor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 hasAuditor
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 isAuditable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2/**
3 * Pop PHP Framework (http://www.popphp.org/)
4 *
5 * @link       https://github.com/popphp/popphp-framework
6 * @author     Nick Sagona, III <dev@nolainteractive.com>
7 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
8 * @license    http://www.popphp.org/license     New BSD License
9 */
10
11/**
12 * @namespace
13 */
14namespace Pop\Audit\Model;
15
16use Pop\Audit\Auditor;
17use Pop\Model\AbstractModel;
18
19/**
20 * Abstract auditable model class
21 *
22 * @category   Pop
23 * @package    Pop\Audit
24 * @author     Nick Sagona, III <dev@nolainteractive.com>
25 * @copyright  Copyright (c) 2009-2023 NOLA Interactive, LLC. (http://www.nolainteractive.com)
26 * @license    http://www.popphp.org/license     New BSD License
27 * @version    1.3.0
28 */
29abstract class AuditableModel extends AbstractModel implements AuditableInterface
30{
31
32    /**
33     * Auditor object
34     * @var Auditor
35     */
36    protected $auditor = null;
37
38    /**
39     * Set the auditor object
40     *
41     * @param  Auditor $auditor
42     * @return self
43     */
44    public function setAuditor(Auditor $auditor)
45    {
46        $this->auditor = $auditor;
47        return $this;
48    }
49
50    /**
51     * Get the auditor object
52     *
53     * @return Auditor
54     */
55    public function getAuditor()
56    {
57        return $this->auditor;
58    }
59
60    /**
61     * Determine if the model has auditor
62     *
63     * @return boolean
64     */
65    public function hasAuditor()
66    {
67        return (null !== $this->auditor);
68    }
69
70    /**
71     * Determine if the model is auditable
72     *
73     * @return boolean
74     */
75    public function isAuditable()
76    {
77        return (null !== $this->auditor);
78    }
79
80}