<?php

namespace BwWinnersGlobalSite\Entities;

if ( ! class_exists( __NAMESPACE__ . '\Entity_Store' ) ) {

	class Entity_Store {

		private Competition_Store $competitions;
		private Brand_Store $brands;
		private Product_Store $products;

		public function __construct( Competition_Store $competitions, Brand_Store $brands, Product_Store $products ) {
			$this->competitions = $competitions;
			$this->brands = $brands;
			$this->products = $products;
		}

		public function clean ( $update_at ) {
			$this->products->clean( $update_at );
			$this->brands->clean( $update_at );
			$this->competitions->clean( $update_at );
		}


		// ----------------------------------------------------------------------------
		// Brand
		// ----------------------------------------------------------------------------

		public function get_brands () {
			return $this->brands->get_brands();
		}

		public function get_brand ( $brand_id ) {
			return $this->brands->get_brand( $brand_id );
		}

		public function get_brand_id ( $import_id ) {
			return $this->brands->get_brand_id( $import_id );
		}

		public function get_brand_id_from_name ( $brand_name ) {
			return $this->brands->get_brand_id_from_name( $brand_name );
		}

		public function update_brand ( $brand ) {
			return $this->brands->update_brand( $brand );
		}

		public function delete_brand ( $brand_id ) {
			return $this->brands->delete_brand( $brand_id );
		}

		public function get_brand_posts ( $brand_id ) {
			return $this->brands->get_brand_posts( $brand_id );
		}

		public function set_brand_posts ( $brand_id, $post_ids ) {
			return $this->brands->set_brand_posts( $brand_id, $post_ids );
		}

		public function get_post_brands ( $brand_id ) {
			return $this->brands->get_post_brands( $brand_id );
		}

		public function set_post_brands ( $post_id, $brand_ids ) {
			return $this->brands->set_post_brands( $post_id, $brand_ids );
		}


		// ----------------------------------------------------------------------------
		// Brand Awards
		// ----------------------------------------------------------------------------

		public function get_brand_awards ( $brand_id ) {
			return $this->brands->get_brand_awards( $brand_id );
		}

		public function set_brand_awards ( $brand_id, $awards ) {
			return $this->brands->set_brand_awards( $brand_id , $awards);
		}

		public function delete_brand_awards ( $brand_id ) {
			return $this->brands->delete_brand_awards( $brand_id );
		}

		public function get_brand_award ( $award_id ) {
			return $this->brands->get_brand_award( $award_id );
		}

		public function update_brand_award ( $award ) {
			return $this->brands->update_brand_award( $award );
		}

		public function delete_brand_award ( $award_id ) {
			return $this->brands->delete_brand_award( $award_id );
		}


		// ----------------------------------------------------------------------------
		// Product
		// ----------------------------------------------------------------------------

		public function get_products () {
			return $this->products->get_products();
		}

		public function get_product ( $product_id ) {
			return $this->products->get_product( $product_id );
		}

		public function get_product_id ( $import_id ) {
			return $this->products->get_product_id( $import_id );
		}

		public function get_product_id_from_name ( $product_name, $brand_id ) {
			return $this->products->get_product_id_from_name( $product_name, $brand_id );
		}

		public function update_product ( $product ) {
			return $this->products->update_product( $product );
		}

		public function delete_product ( $product_id ) {
			return $this->products->delete_product( $product_id );
		}


		// ----------------------------------------------------------------------------
		// Product Awards
		// ----------------------------------------------------------------------------

		public function get_product_awards ( $product_id ) {
			return $this->products->get_product_awards( $product_id );
		}

		public function set_product_awards ( $product_id, $awards ) {
			return $this->products->set_product_awards( $product_id , $awards);
		}

		public function delete_product_awards ( $product_id ) {
			return $this->products->delete_product_awards( $product_id );
		}

		public function get_product_award ( $award_id ) {
			return $this->products->get_product_award( $award_id );
		}

		public function update_product_award ( $award ) {
			return $this->products->update_product_award( $award );
		}

		public function delete_product_award ( $award_id ) {
			return $this->products->delete_product_award( $award_id );
		}


		// ----------------------------------------------------------------------------
		// Product Entries
		// ----------------------------------------------------------------------------

		public function get_product_entries ( $product_id ) {
			return $this->products->get_product_entries( $product_id );
		}

		public function set_product_entries ( $product_id, $entries ) {
			return $this->products->set_product_entries( $product_id, $entries );
		}

		public function delete_product_entries ( $product_id ) {
			return $this->products->delete_product_entries( $product_id );
		}

		public function get_entry ( $entry_id ) {
			return $this->products->get_entry( $entry_id );
		}

		public function update_entry ( $entry ) {
			return $this->products->update_entry( $entry );
		}

		public function delete_entry ( $entry_id ) {
			return $this->products->delete_entry( $entry_id );
		}


		// ----------------------------------------------------------------------------
		// Competition
		// ----------------------------------------------------------------------------

		public function get_competitions () {
			return $this->competitions->get_competitions();
		}

		public function get_competition ( $competition_id ) {
			return $this->competitions->get_competition( $competition_id );
		}

		public function get_competition_id ( $name ) {
			return $this->competitions->get_competition_id( $name );
		}

		public function update_competition ( $competition ) {
			return $this->competitions->update_competition( $competition );
		}

		public function delete_competition ( $competition_id ) {
			return $this->competitions->delete_competition( $competition_id );
		}

		public function get_competition_entries ( $competition_id ) {
			return $this->competitions->get_competition_entries( $competition_id );
		}

		public function get_competition_product_categories ( $competition_id ) {
			return $this->competitions->get_competition_product_categories( $competition_id );
		}
	}
}
