I got the models Post and Category. A Post is assigned to a Category. A Category has many Posts. They should be stored in a database. I implemented the following classes for it:Models/Post.php:class Post {    /**     * Title of the post.     *     * @var string     */    public $title;    /**     * The category that is assigned to the post.     *     * @var Category     */    public $category;    public function __construct($title, Category $category) {        $this->title = $title;        $this->category = $category;    }}Models/Category.php:class Category {    /**     * Name of the category.     *     * @var string     */    public $name;    /**     * Posts that are assigned to this category.     *     * @var Post[]     */    public $posts;    public function __construct($name, array $posts) {        $this->name = $name;        $this->posts = $posts;    }}When I want to display a post, I will fetch it via an ID from a database. But what about the category? When I want to get the name of the category (to display it in the meta informations below the post) I have to fetch all posts that belongs to this category.So my questions is: Is it better to store the IDs of the posts in Category::$posts instead the entire objects?
Relationship between objects
php