本文整理汇总了PHP中TMS函数的典型用法代码示例。如果您正苦于以下问题:PHP TMS函数的具体用法?PHP TMS怎么用?PHP TMS使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了TMS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: classNameInstanceOfBaseObject
public static function classNameInstanceOfBaseObject($className)
{
$obj = Factory::createObject($className);
if ($obj instanceof BaseObject === false) {
throw new BaseException(TMS(BaseException::CLASS_NOT_INSTANCEOF_BASOBJECT, array('class' => $className)));
}
}
示例2: setSelectedLanguage
/**
* set a language for displaying
*
* @param $language
* @throws BaseException
*/
public function setSelectedLanguage($language)
{
if (in_array($language, $this->getPossibleLanguages()) === false) {
throw new BaseException(TMS(BaseException::LANGUAGE_NOT_SUPPORTED, array('language' => $language)));
}
$this->selectedLanguage = $language;
}
示例3: validateParams
/**
* @throws base_exception_Validation
*/
public function validateParams()
{
parent::validateParams();
if (is_null($this->requestHelper->getParam('class'))) {
throw new base_exception_Site(TMS(base_exception_Site::MISSING_PARAM, ['name' => 'class']));
}
}
示例4: __construct
public function __construct(BaseObject $obj)
{
if ($this->checkObjClass($obj) == false) {
throw new base_displayclass_Exception(TMS(base_displayclass_Exception::NOT_SUPPORTED_CLASS, array('class' => get_class($obj), 'displayClass' => get_class($this))));
}
$this->obj = $obj;
}
示例5: getColumn
/**
* @param $colName
* @return base_database_Column
* @throws base_database_Exception
*/
public function getColumn($colName)
{
if ($this->existsColumn($colName) === false) {
throw new base_database_Exception(TMS(base_database_Exception::TABLE_COLUMN_NOT_EXISTS, array('colName' => $colName, 'tableName' => $this->name)));
}
return $this->cols[$colName];
}
示例6: setValue
/**
* set a new int value
*
* @param int $value
* @throws base_database_Exception
*/
public function setValue($value)
{
if (is_int($value) === false) {
throw new base_database_Exception(TMS(base_database_Exception::NO_INT_VALUE, array('value' => $value)));
}
$this->int = $value;
}
示例7: __construct
/**
* @throws base_exception_CMD
*/
public function __construct()
{
if (!isset($GLOBALS['argv'])) {
throw new base_exception_CMD(TMS(base_exception_CMD::NO_CMD_CALL));
}
$this->setParams();
$this->model = $this->getModel();
}
示例8: toString
/**
* generate sql string
* @return string
* @throws base_database_Exception
*/
public function toString()
{
if (empty($this->columns)) {
throw new base_database_Exception(TMS(base_database_Exception::NO_COLS_ADDED, array('tableName', $this->name)));
}
$sql = 'CREATE TABLE IF NOT EXISTS ' . $this->name . ' (';
$sql .= implode(', ', $this->columns) . ')';
return $sql;
}
示例9: setTableData
/**
* @param array $data
* @throws base_exception_BasePDF
*/
public function setTableData(array $data)
{
foreach ($data as $obj) {
if (!$obj instanceof BaseObject) {
throw new base_exception_BasePDF(TMS(base_exception_BasePDF::DATA_NO_INSTANCEOF_BASEOBJECT));
}
}
$this->data = $data;
}
示例10: createObject
/**
* get a new instance of the given className
*
* @param $className
* @return BaseObject
* @throws BaseException
*/
public static function createObject($className, BaseObject $obj)
{
Check::className($className);
$dPObj = new $className($obj);
if (!$dPObj instanceof DataPermission) {
throw new base_exception_DataPermission(TMS(base_exception_DataPermission::FACTORY_NO_INSTANCE_OF_DP));
}
return $dPObj;
}
示例11: toStringTest
/**
* @param $value
* @param $expectedException
* @throws base_database_Exception
*
* @test
* @dataProvider toStringTestDataProvider
*/
public function toStringTest($value, $expectedException)
{
if ($expectedException === true) {
$this->setExpectedException('base_database_Exception', TMS(base_database_Exception::NO_INT_VALUE, array('value' => $value)));
}
$term = new base_database_term_Int();
$term->setValue($value);
$this->assertEquals($value, $term->toString());
}
示例12: toString
/**
* generate sql string
*
* @return string
* @throws base_database_Exception
*/
public function toString()
{
$result = 'DELETE FROM ';
$result .= $this->table->getName();
if (empty($this->where)) {
throw new base_database_Exception(TMS(base_database_Exception::NO_WHERE_GIVEN));
}
$result .= ' WHERE ';
$result .= $this->where->toString();
return $result;
}
示例13: exception_handler
function exception_handler(Exception $exception) {
$div = Html::startTag('div', array('id' => 'exceptionBox'));
$div .= Html::startTag('p', array('class' => 'h3')) . TMS(BaseException::HEADLINE) . Html::endTag('p');
$div .= Html::startTag('hr');
$div .= $exception->getMessage();
$div .= Html::endTag('div');
print($div);
if ($exception instanceof BaseException) {
$exception->debugOut();
}
}
示例14: __construct
/**
* @param string $dbName
* @throws base_database_Exception
*/
public function __construct($dbName = '')
{
if (empty($dbName)) {
$dbName = Configuration::get()->getEntry('dbName');
}
if (empty($dbName)) {
throw new base_database_Exception(TMS(base_database_Exception::DB_DBNAME_MISSED));
}
$this->dbName = $dbName;
}
示例15: mapFieldValue
public function mapFieldValue($value)
{
$obj = Factory::createObject('vendor');
$table = DB::table($obj->getTable());
$where = DB::where($table->getColumn('name'), DB::term($value));
$finder = Finder::create('vendor')->setWhere($where);
$result = $finder->find(array($table->getColumn('LK')));
if (count($result) > 1) {
throw new base_exception_Mapper(TMS('medexchange.exception.mapper.vendorDuplicatedEntry'));
}
$lkArray = $result[0];
return $lkArray['LK'];
}