1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-07-03 06:55:03 +03:00
ifhub.club/application/classes/modules/property/entity/ValueTypeCheckbox.entity.class.php

37 lines
926 B
PHP

<?php
/**
* LiveStreet CMS
* Copyright © 2013 OOO "ЛС-СОФТ"
*
* ------------------------------------------------------
*
* Official site: www.livestreetcms.com
* Contact e-mail: office@livestreetcms.com
*
* GNU General Public License, version 2:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*
* ------------------------------------------------------
*
* @link http://www.livestreetcms.com
* @copyright 2013 OOO "ЛС-СОФТ"
* @author Maxim Mzhelskiy <rus.engine@gmail.com>
*
*/
class ModuleProperty_EntityValueTypeCheckbox extends ModuleProperty_EntityValueType {
public function getValueForDisplay() {
return (bool)$this->getValueObject()->getValueInt();
}
public function validate() {
return $this->validateStandart('boolean');
}
public function setValue($mValue) {
$this->resetAllValue();
$oValue=$this->getValueObject();
$oValue->setValueInt($mValue ? 1 : 0);
}
}