jablonka.czprosek.czf

freenet-router

Subversion Repositories:
[/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Framework/] [Libraries/] [Forms/] [Model/] [FormField.php] - Rev 2

Compare with Previous - Blame - Download


<?php

namespace Phem\Libraries\Forms\Model;

/**
 * @Entity(readOnly=true) @Table(name="povruc_form_field") 
 * 
 */
class FormField
{

    /** @Id @Column(type="integer") */
    protected $id;

    /**
     * @ManyToOne(targetEntity="FormGroup",cascade={"all"})
     * @JoinColumn(name="group", referencedColumnName="id") 
     */
    protected $group;

    /** @Column(type="string") */
    protected $name;

    /** @Column(type="string") */
    protected $caption;

    /** @Column(type="string") */
    protected $type;

    /** @Column(type="string") */
    protected $note;

    /** @Column(type="boolean") */
    protected $required;
    protected $readOnly;

    /** @Column(type="boolean") */
    protected $enabled;

    /** @Column(type="integer") */
    protected $order;
    protected $options;
    protected $value;

    /**
     *
     * @OneToMany(targetEntity="FormFieldValidation", mappedBy="field",cascade={"all"})
     */
    protected $rules; //set of rules for validation
    /**
     *
     * @OneToMany(targetEntity="FormFieldCondition", mappedBy="sourceField",cascade={"all"})
     */
    protected $triggers; //set of conditions which are based on value of this field (where this is trigger)

    /**
     *
     * @OneToMany(targetEntity="FormFieldCondition", mappedBy="targetField",cascade={"all"})
     */
    protected $dependencies; //set of conditions which are based on value of this field (where this is trigger)

    public function getId()
    {
        return $this->id;
    }

    public function setId($id)
    {
        $this->id = $id;
    }

    public function getDependencies()
    {
        return $this->dependencies;
    }

    public function setDependencies($dependencies)
    {
        $this->dependencies = $dependencies;
    }

    public function getGroup()
    {
        return $this->group;
    }

    public function setGroup($group)
    {
        $this->group = $group;
    }

    public function getName()
    {
        return $this->name;
    }

    public function setName($name)
    {
        $this->name = $name;
    }

    public function getCaption()
    {
        return $this->caption;
    }

    public function setCaption($caption)
    {
        $this->caption = $caption;
    }

    public function getType()
    {
        return $this->type;
    }

    public function setType($type)
    {
        $this->type = $type;
    }

    public function getNote()
    {
        return $this->note;
    }

    public function setNote($note)
    {
        $this->note = $note;
    }

    public function getRequired()
    {
        return $this->required;
    }

    public function setRequired($required)
    {
        $this->required = $required;
    }

    public function getReadOnly()
    {
        return $this->readOnly;
    }

    public function setReadOnly($readOnly)
    {
        $this->readOnly = $readOnly;
    }

    public function getEnabled()
    {
        return $this->enabled;
    }

    public function setEnabled($enabled)
    {
        $this->enabled = $enabled;
    }

    public function getOrder()
    {
        return $this->order;
    }

    public function setOrder($order)
    {
        $this->order = $order;
    }

    public function getRules()
    {
        return $this->rules;
    }

    public function setRules($rules)
    {
        $this->rules = $rules;
    }

    public function getTriggers()
    {
        return $this->triggers;
    }

    public function setTriggers($triggers)
    {
        $this->triggers = $triggers;
    }

    public function isTrigger()
    {
        return (count($this->triggers) > 0 );
    }

    public
            function getValue()
    {
        return $this->value;
    }

    public
            function setValue($value)
    {
        $this->value = $value;
    }

    public function getOptions()
    {
        return $this->options;
    }

    public function setOptions($options)
    {
        $this->options = $options;
    }

    public function isTriggerErase()
    {
        $ret = false;
        foreach ($this->triggers as $t)
        {
            if ($t->getAction() == "erase")
            {
                $ret = true;
            }
        }
        return $ret;
    }

}

Powered by WebSVN 2.2.1