Publication::getIsVisible()   A
last analyzed

Complexity

Conditions 3
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 8
rs 9.4286
cc 3
eloc 4
nc 2
nop 0
1
<?php
2
3
namespace Fenrizbes\PublicationsBundle\Model;
4
5
use Fenrizbes\PublicationsBundle\Model\om\BasePublication;
6
7
class Publication extends BasePublication
8
{
9
  
10
    /**
11
     * Проверяем видимость новости для посетителей
12
     * @return bool
13
     * @throws \PropelException
14
     */
15
    public function getIsVisible()
16
    {
17
        if ($this->getIsPublished() && $this->getCreatedAt() <= new \DateTime('now')) {
18
            return true;
19
        }
20
21
        return false;
22
    }  
23
  
24
}
25