<?php

namespace GemBoards\Entities;

use GemBoards\Classes\AbstractEntity;
use GemBoards\Utils\Helper;

class Bookmark extends AbstractEntity {

	protected string $table       = Helper::BOOKMARKS_TABLE_NAME;
	protected string $object_type = 'bookmark';

	protected array $data = [
		'user_id'            => 0,
		'project_id'         => 0,
		'target_object_id'   => 0,
		'target_object_type' => '',
		'created_at'         => '',
	];

	public function get_project_id( string $context = 'view' ): int {
		return (int) $this->get_prop( 'project_id', $context );
	}

	public function get_user_id( string $context = 'view' ): int {
		return (int) $this->get_prop( 'user_id', $context );
	}

	public function get_target_object_id( string $context = 'view' ): int {
		return (int) $this->get_prop( 'target_object_id', $context );
	}

	public function get_target_object_type( string $context = 'view' ): string {
		return $this->get_prop( 'target_object_type', $context );
	}

	public function get_date_created( string $context = 'view' ): string {
		return $this->get_prop( 'created_at', $context );
	}

	public function set_project_id( int $value ) {
		$this->set_prop( 'project_id', $value );
	}

	public function set_user_id( int $value ) {
		$this->set_prop( 'user_id', $value );
	}

	public function set_target_object_id( int $value ) {
		$this->set_prop( 'target_object_id', $value );
	}

	public function set_target_object_type( string $value ) {
		$this->set_prop( 'target_object_type', $value );
	}

}
