Group_Repository.php
| 1 | <?php // phpcs:ignore WordPress.Files.FileName |
| 2 | /** |
| 3 | * Group Repository class. |
| 4 | * |
| 5 | * @package AdvancedAds |
| 6 | * @author Advanced Ads <info@wpadvancedads.com> |
| 7 | */ |
| 8 | |
| 9 | namespace Advanced_Ads; |
| 10 | |
| 11 | use AdvancedAds\Abstracts\Group; |
| 12 | |
| 13 | /** |
| 14 | * Group Repository/Factory class. |
| 15 | * |
| 16 | * @deprecated 2.0.0 |
| 17 | */ |
| 18 | class Group_Repository { |
| 19 | |
| 20 | /** |
| 21 | * Get the ad object from the repository. Create and add it, if it doesn't exist. |
| 22 | * If the passed id is not an ad, return the created ad object without adding it to the repository. |
| 23 | * This behavior prevents breaking changes. |
| 24 | * |
| 25 | * @deprecated 2.0.0 |
| 26 | * |
| 27 | * @param int|WP_Term $term The term to look for. |
| 28 | * |
| 29 | * @return Group|bool |
| 30 | */ |
| 31 | public static function get( $term ) { |
| 32 | _deprecated_function( __METHOD__, '2.0.0', 'wp_advads_get_group()' ); |
| 33 | return wp_advads_get_group( $term ); |
| 34 | } |
| 35 | } |
| 36 |