types
3 months ago
class-group-ad-relation.php
1 day ago
class-group-factory.php
1 day ago
class-group-ordered.php
1 year ago
class-group-repository.php
1 day ago
class-group-slider.php
5 months ago
class-group-standard.php
1 year ago
class-group-types.php
1 year ago
class-groups.php
1 year ago
index.php
1 year ago
class-group-standard.php
45 lines
| 1 | <?php |
| 2 | /** |
| 3 | * This class is responsible to model standard groups. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | * @since 1.48.0 |
| 8 | */ |
| 9 | |
| 10 | namespace AdvancedAds\Groups; |
| 11 | |
| 12 | use AdvancedAds\Abstracts\Group; |
| 13 | use AdvancedAds\Interfaces\Group_Interface; |
| 14 | |
| 15 | defined( 'ABSPATH' ) || exit; |
| 16 | |
| 17 | /** |
| 18 | * Standard group. |
| 19 | */ |
| 20 | class Group_Standard extends Group implements Group_Interface { |
| 21 | |
| 22 | /** |
| 23 | * Get interval. |
| 24 | * |
| 25 | * @param string $context What the value is for. Valid values are view and edit. |
| 26 | * |
| 27 | * @return int |
| 28 | */ |
| 29 | public function get_interval( $context = 'view' ): int { |
| 30 | return $this->get_prop( 'interval', $context ); |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Is refresh enabled. |
| 35 | * |
| 36 | * @param string $context What the value is for. Valid values are view and edit. |
| 37 | * |
| 38 | * @return bool |
| 39 | */ |
| 40 | public function is_refresh( $context = 'view' ): bool { |
| 41 | $value = $this->get_prop( 'enabled', $context ); |
| 42 | return $value ?? false; |
| 43 | } |
| 44 | } |
| 45 |