<?php

namespace App\Form\Input;

class Cloned_DateInterval extends \Engine\Form\Input\ElementAbstract
{
	protected $class = "clonedDateInterval";

	public function __construct($label=null, $name=null, $value=null)
	{
		parent::__construct($label, $name, $value);

		$this->settings['minItems'] = 1;

		$this->settings['operations'] = [];
		$this->settings['operations']['add'] = true;
		$this->settings['operations']['remove'] = true;
		# $this->settings['operations']['default'] = true;
	}

	/**
	 * (non-PHPdoc)
	 * @see \Engine\Form\Input\Autocomplete::setValue()
	 */
	public function setValue($value){
		// this is the same as the basic setValue function, because i need to override the autocomplete's version
		if(!is_array($value)){
			$value = [];
		}

		$this->value = $value;
		return $this;
	}

	/**
	 * (non-PHPdoc)
	 * @see \Engine\Form\Input\ElementAbstract::loadTranslations()
	 */
	protected function loadTranslations($templateClass = null)
	{
		parent::loadTranslations();


		\App\Loader_Lang::getInstance()->loadAppFile('_customLoad/formField/inputs/inputClonedDateInterval.lang.php');

	}

}
