import('Praspel.Exception.Model') /** * \Hoa\Praspel\Model\Variable */ -> import('Praspel.Model.Variable.~') /** * \Hoa\Realdom\Disjunction */ -> import('Realdom.Disjunction', true); } namespace Hoa\Praspel\Model\Variable { /** * Class \Hoa\Praspel\Model\Variable\Implicit. * * Represent an implicit variable. * * @author Ivan Enderlin * @copyright Copyright © 2007-2014 Ivan Enderlin. * @license New BSD License */ class Implicit extends Variable { /** * Build a variable. * * @access public * @param string $name Name. * @param bool $local Local. * @param \Hoa\Praspel\Model\Clause $clause Clause. * @return void * @throw \Hoa\Praspel\Exception\Model */ public function __construct ( $name, $local, \Hoa\Praspel\Model\Clause $clause = null ) { if('this' !== $name) throw new \Hoa\Praspel\Exception\Model( 'Variable %s is not an implicit one.', 0, $name); parent::__construct($name, $local, $clause); $this->in = realdom()->object(); return; } /** * Bind the variable to a specific value. * * @access public * @param mixed $value Value. * @return void */ public function bindTo ( $value ) { foreach($this->getDomains() as $domain) if($domain instanceof \Hoa\Realdom\Object) $domain->setObject($value); return; } } }