<?php
namespace SabaiApps\Framework\Criteria;

/**
 * Abstract base class for value-based criteria.
 * Stores a field name and a value for use in criteria evaluation.
 */
abstract class AbstractValueCriteria extends AbstractCriteria {

	/**
	 * @var string The field name to apply the criteria to.
	 */
	private $_field;

	/**
	 * @var mixed The value for the criteria.
	 */
	private $_value;

	/**
	 * Constructor.
	 *
	 * @param string $field The field name.
	 * @param mixed  $value The value to compare.
	 */
	public function __construct( $field, $value ) {
		$this->_field = $field;
		$this->_value = $value;
	}

	/**
	 * Gets the field name.
	 *
	 * @return string
	 */
	public function getField() {
		return $this->_field;
	}

	/**
	 * Gets the value.
	 *
	 * @return mixed
	 */
	public function getValue() {
		return $this->_value;
	}
}
