| 1 |
<?php |
| 2 |
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure. |
| 3 |
|
| 4 |
namespace Yoast\WP\SEO\AI\Content_Planner\Application; |
| 5 |
|
| 6 |
use Yoast\WP\SEO\AI\Content_Planner\Domain\Category; |
| 7 |
|
| 8 |
/** |
| 9 |
* Interface for resolving categories from the blog. |
| 10 |
*/ |
| 11 |
interface Category_Repository_Interface { |
| 12 |
|
| 13 |
/** |
| 14 |
* Finds a category by name, returning the empty-category sentinel when no term matches. |
| 15 |
* |
| 16 |
* The empty-category sentinel is a Category with name "" and id -1. It signals "no category" |
| 17 |
* to the frontend so it can hide the category UI and skip applying any category to the post. |
| 18 |
* |
| 19 |
* @param string $name The category name. |
| 20 |
* |
| 21 |
* @return Category The resolved category, or the empty-category sentinel when no term matches. |
| 22 |
*/ |
| 23 |
public function find_by_name( string $name ): Category; |
| 24 |
} |
| 25 |
|