• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DataType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中DataType的典型用法代码示例。如果您正苦于以下问题:PHP DataType类的具体用法?PHP DataType怎么用?PHP DataType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DataType类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: typeToString

 public function typeToString(DataType $type)
 {
     if ($type->getId() == DataType::BINARY) {
         return 'BLOB';
     }
     return parent::typeToString($type);
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:7,代码来源:MyDialect.class.php


示例2: typeToString

 public function typeToString(DataType $type)
 {
     if ($type->getId() == DataType::IP) {
         return 'varchar(19)';
     }
     if ($type->getId() == DataType::IP_RANGE) {
         return 'varchar(41)';
     }
     return $type->getName();
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:10,代码来源:Dialect.class.php


示例3: typeToString

 public function typeToString(DataType $type)
 {
     switch ($type->getId()) {
         case DataType::BIGINT:
             return 'INTEGER';
         case DataType::BINARY:
             return 'BLOB';
     }
     return parent::typeToString($type);
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:10,代码来源:LiteDialect.class.php


示例4: displaySharing

 private function displaySharing()
 {
     $url = UrlRewriting::GetUrlByAlias("admin/data/share", "datatype=" . urlencode($_GET['show']) . "&blank=true");
     $shares = Language::DirectTranslateHtml("SHARES");
     $newshare = Language::DirectTranslateHtml("NEW_SHARE");
     echo "<h2>" . $shares . "</h2><a href=\"javascript:showIFrameDialog('" . $newshare . "',300,200,'" . $url . "',true);\">" . $newshare . "</a>";
     $datatype = new DataType($_GET['show']);
     foreach ($datatype->getShares() as $share) {
         echo "<br /><br />" . $share->GetName() . ":<br /><a href='" . $share->getUrl() . "'>" . $share->getUrl() . "</a>";
     }
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:11,代码来源:datacenter.php


示例5: __construct

 /**
  * The NumberParser can parse integer and double datatypes.
  * With NumberParser::setLanguage(en/de/it/es ...) one could set up a Language.
  * The default language is english (en).
  *
  * @param DataType $datatype
  */
 public function __construct($datatype)
 {
     $this->setLanguage('en');
     $this->dataType = $datatype;
     if ($datatype->getName() == 'xsd:integer') {
         $this->integer = true;
     } elseif ($datatype->getName() == 'xsd:double') {
         $this->double = true;
     } else {
         throw new DataParserException("wrong parameter.");
     }
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:19,代码来源:NumberParser.php


示例6: testGetInputType

 /** 
  * test if the method getInputType returns the correct inputtype
  */
 public function testGetInputType()
 {
     $DataType = new DataType();
     $this->assertEquals('number', $DataType->getInputType('int'));
     $this->assertEquals('checkbox', $DataType->getInputType('bool'));
     $this->assertEquals('file', $DataType->getInputType('blob'));
     $this->assertEquals('single', $DataType->getInputType('binary'));
     $this->assertEquals('text', $DataType->getInputType('text'));
     $this->assertEquals('select-multiple', $DataType->getInputType('set'));
     $this->assertEquals('date', $DataType->getInputType('date'));
     $this->assertEquals('datetime', $DataType->getInputType('datetime'));
     $this->assertEquals('number', $DataType->getInputType('year'));
 }
开发者ID:cebe,项目名称:chive,代码行数:16,代码来源:DataTypeTest.php


示例7: typeToString

 public function typeToString(DataType $type)
 {
     if ($type->getId() == DataType::BINARY) {
         return 'BYTEA';
     }
     if (defined('POSTGRES_IP4_ENABLED')) {
         if ($type->getId() == DataType::IP) {
             return 'ip4';
         }
         if ($type->getId() == DataType::IP_RANGE) {
             return 'ip4r';
         }
     }
     return parent::typeToString($type);
 }
开发者ID:rero26,项目名称:onphp-framework,代码行数:15,代码来源:PostgresDialect.class.php


示例8: dataTypeForValue

 /**
  * DataType for value
  *
  * @param   mixed  $pValue
  * @return  string
  */
 public static function dataTypeForValue($pValue = null)
 {
     // Match the value against a few data types
     if ($pValue === null) {
         return DataType::TYPE_NULL;
     } elseif ($pValue === '') {
         return DataType::TYPE_STRING;
     } elseif ($pValue instanceof \PHPExcel\RichText) {
         return DataType::TYPE_INLINE;
     } elseif ($pValue[0] === '=' && strlen($pValue) > 1) {
         return DataType::TYPE_FORMULA;
     } elseif (is_bool($pValue)) {
         return DataType::TYPE_BOOL;
     } elseif (is_float($pValue) || is_int($pValue)) {
         return DataType::TYPE_NUMERIC;
     } elseif (preg_match('/^[\\+\\-]?([0-9]+\\.?[0-9]*|[0-9]*\\.?[0-9]+)([Ee][\\-\\+]?[0-2]?\\d{1,3})?$/', $pValue)) {
         $tValue = ltrim($pValue, '+-');
         if (is_string($pValue) && $tValue[0] === '0' && strlen($tValue) > 1 && $tValue[1] !== '.') {
             return DataType::TYPE_STRING;
         } elseif (strpos($pValue, '.') === false && $pValue > PHP_INT_MAX) {
             return DataType::TYPE_STRING;
         }
         return DataType::TYPE_NUMERIC;
     } elseif (is_string($pValue) && array_key_exists($pValue, DataType::getErrorCodes())) {
         return DataType::TYPE_ERROR;
     }
     return DataType::TYPE_STRING;
 }
开发者ID:kameshwariv,项目名称:testexample,代码行数:34,代码来源:DefaultValueBinder.php


示例9: getInternalColumns

 protected function getInternalColumns()
 {
     if (is_null($this->columns)) {
         $this->columns = array();
         $keyLength = $this->getKeyLength();
         if (is_null($keyLength)) {
             throw new ErrorException("Cannot create meta-table-schema for indicies when no key-length is specified!");
         }
         $columnPage = new Column();
         for ($i = 1; $i <= 33; $i++) {
             $columnPage->setName("ref{$i}");
             $columnPage->setDataType(DataType::INT());
             $columnPage->setLength($keyLength);
             $columnPage->setExtraFlags(Column::EXTRA_PRIMARY_KEY);
             $this->columns[] = clone $columnPage;
             $columnPage->setName("val{$i}");
             $columnPage->setDataType(DataType::INT());
             $columnPage->setLength($keyLength);
             $columnPage->setExtraFlags(Column::EXTRA_PRIMARY_KEY);
             $this->columns[] = clone $columnPage;
             $columnPage->setName("row{$i}");
             $columnPage->setDataType(DataType::INT());
             $columnPage->setLength($keyLength);
             $columnPage->setExtraFlags(Column::EXTRA_PRIMARY_KEY);
             $this->columns[] = clone $columnPage;
         }
     }
     return $this->columns;
 }
开发者ID:addiks,项目名称:phpsql,代码行数:29,代码来源:Indicies.php


示例10: save

function save()
{
    if ($username == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            if ($password != $password2) {
                echo "Please make sure your passwords match.";
            } else {
                ProgressIndicator::Show();
                $url = "http://demo.kikapptools.com/Gastos/crud/updateUser.php";
                $httpClient_post = new httpClient();
                $inputMetodo = new InputText();
                $inputMetodo->setValue("login");
                $httpClient_post->addVariable('username', $username);
                $httpClient_post->addVariable('password', $password);
                $httpClient_post->addVariable('id', $token);
                $result = $httpClient_post->Execute('POST', $url);
                $id_user = new InputText();
                $struct = array("response" => DataType::Character(50));
                Data::FromJson($struct, $result);
                $id_user = $struct['response'];
                ProgressIndicator::Hide();
                AndroidAction::GoHome();
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:30,代码来源:Settings.php


示例11: getByDataType

 /**
  *
  * @param DataType $type
  * @return DataTypeValidator 
  */
 public static function getByDataType(DataType $type)
 {
     $res = array();
     $dataTypeID = DataBase::Current()->EscapeString($type->getID());
     $rows = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}datatype_validator WHERE dataType = '" . $dataTypeID . "'");
     foreach ($rows as $row) {
         $validator = new DataTypeValidator();
         $validator->id = $row->id;
         $validator->dataTypeID = $row->dataType;
         $validator->dataType = $type;
         $validator->select = $row->select;
         $validator->message = $row->message;
         $res[] = $validator;
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:21,代码来源:datatypevalidator.php


示例12: login

function login()
{
    if ($email == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($pass == null) {
            echo "Password is a required field.";
        } else {
            ProgressIndicator::Show();
            $url = "http://demo.kikapptools.com/magento/apiKikApp/api.php?metodo=login";
            $httpClient_post = new httpClient();
            $httpClient_post->addVariable('email', $email);
            $httpClient_post->addVariable('password', $pass);
            $result = $httpClient_post->Execute('POST', $url);
            $customerToken = new InputText();
            $userName = new InputText();
            $response = array("customerToken" => DataType::Character(150), "userName" => DataType::Character(150));
            Data::FromJson($response, $result);
            $customerToken = $response['customerToken'];
            $userName = $response['userName'];
            ProgressIndicator::Hide();
            if ($customerToken != "") {
                StorageAPI::Set("token", $customerToken);
                StorageAPI::Set("userName", $userName);
                AndroidAction::GoHome();
            } else {
                echo "Invalid user";
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:31,代码来源:Login.php


示例13: login

function login()
{
    if ($username == null) {
        echo "E-Mail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            ProgressIndicator::Show();
            $url = "http://demo.kikapptools.com/Gastos/crud/Login.php";
            $httpClient_post = new httpClient();
            $inputMetodo = new InputText();
            $inputMetodo->setValue("login");
            $httpClient_post->addVariable('username', $username);
            $httpClient_post->addVariable('password', $password);
            $result = $httpClient_post->Execute('POST', $url);
            $id_user = new InputText();
            $struct = array("response" => DataType::Character(50));
            Data::FromJson($struct, $result);
            $id_user = $struct['response'];
            ProgressIndicator::Hide();
            if ($id_user != "0") {
                StorageAPI::Set("token", $id_user);
                AndroidAction::GoHome();
            } else {
                echo "Wrong user or password";
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:30,代码来源:Login.php


示例14: save

function save()
{
    if ($email == null) {
        echo "EMail is a required field.";
    } else {
        if ($password == null) {
            echo "Password is a required field.";
        } else {
            if ($password != $password_2) {
                echo "Please make sure your passwords match.";
            } else {
                ProgressIndicator::Show();
                $url = "http://demo.kikapptools.com/Gastos/crud/Register.php";
                $http = new httpClient();
                $http->addVariable('username', $email);
                $http->addVariable('passcode', $password);
                //lo de pasar la clave a md5 lo hace el Register.php
                $result = $http->Execute('POST', $url);
                $struct = array("id_usuario" => DataType::Character(101));
                Data::FromJson($struct, $result);
                $id_user = new InputText(100);
                $id_user = $struct['id_usuario'];
                if ($id_user == "0") {
                    echo "User already signed up";
                } else {
                    echo "Signed up succesfully.";
                    StorageAPI::Set("token", $id_user);
                    AndroidAction::GoHome();
                }
            }
        }
    }
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:33,代码来源:Register.php


示例15: load_data

function load_data()
{
    $url = "http://www.devxtend.com/Gecko/samples/3_2/rest/main_load_data";
    $hc = new httpClient();
    $rs = $hc->Execute("GET", $url);
    $struct = array(array("id" => DataType::Character(6), "name" => DataType::Character(100)));
    Data::FromJson($struct, $rs);
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:8,代码来源:main.php


示例16: getByDataType

 /**
  *
  * @param DataType $dataType
  * @return array 
  */
 public static function getByDataType(DataType $dataType)
 {
     $res = array();
     $dataTypeID = DataBase::Current()->EscapeString($dataType->getID());
     $fields = DataBase::Current()->ReadRows("SELECT * FROM {'dbprefix'}datafields WHERE datatype = '" . $dataTypeID . "'");
     foreach ($fields as $field) {
         $fieldObj = new DataField();
         $fieldObj->id = $field->id;
         $fieldObj->dataTypeID = $field->dataType;
         $fieldObj->dataType = $dataType;
         $fieldObj->displayName = $field->displayName;
         $fieldObj->dataName = $field->dataName;
         $fieldObj->validatorID = $field->validator;
         $res[] = $fieldObj;
     }
     return $res;
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:22,代码来源:datafield.php


示例17: load_cat

function load_cat()
{
    $url = "http://demo.kikapptools.com/Gastos/crud/getCategories.php";
    $hc = new httpClient();
    $rs = $hc->Execute("GET", $url);
    $struct = array(array("idCat" => DataType::Numeric(11), "name" => DataType::Character(80), "desc" => DataType::Character(200)));
    Data::FromJson($struct, $rs);
}
开发者ID:KikAppTools,项目名称:KikAppDemos,代码行数:8,代码来源:IncomeOutcome.php


示例18: loadCity

function loadCity()
{
    $url = "http://demo.kikapptools.com/HttpClientEjemplo/crud/getCity.php";
    $httpClient = new httpClient();
    $result = $httpClient->Execute('GET', $url);
    $struct = array("nombreCiudad" => DataType::Character(150));
    Data::FromJson($struct, $result);
    $city = $product['nombreCiudad'];
}
开发者ID:KikAppTools,项目名称:KikAppExamples,代码行数:9,代码来源:main.php


示例19: testGetList

 public function testGetList()
 {
     $primitive = Primitive::enumeration('enum')->of('DataType');
     $enum = DataType::create(DataType::getAnyId());
     $this->assertEquals($primitive->getList(), $enum->getObjectList());
     $primitive->setDefault($enum);
     $this->assertEquals($primitive->getList(), $enum->getObjectList());
     $primitive->import(array('enum' => DataType::getAnyId()));
     $this->assertEquals($primitive->getList(), $enum->getObjectList());
 }
开发者ID:onphp-framework,项目名称:onphp-framework,代码行数:10,代码来源:PrimitiveEnumerationTest.class.php


示例20: run

    public function run()
    {
        $type = DataType::getInputType($this->column->dbType);
        $this->htmlOptions += $this->fixedHtmlOptions[$type];
        $column = $this->column->name;
        $name = isset($this->htmlOptions['name']) ? $this->htmlOptions['name'] : 'Row[' . $column . ']';
        switch ($type) {
            case 'number':
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                break;
            case 'select':
                echo CHtml::activeDropDownList($this->row, $column, $this->getEnumValues(), $this->htmlOptions);
                break;
            case 'select-multiple':
                #echo CHtml::activeListBox($this->row, $column, $this->getSetValues(), $this->htmlOptions);
                echo CHtml::listBox($name, $this->row->getAttributeAsArray($column), $this->getSetValues(), $this->htmlOptions);
                break;
            case 'text':
                echo CHtml::activeTextArea($this->row, $column, $this->htmlOptions);
                break;
            case 'file':
                echo '<script type="text/javascript">
					$(document).ready(function() {
						$("# echo CHtml::$idPrefix; ?>").submit(function() {
							alert("ok1");
							
						});
					});
					</script>';
                echo CHtml::activeFileField($this->row, $column, $this->htmlOptions);
                break;
            case 'date':
                $this->SetDateTimeHtmlOptions($column);
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                echo '<script type="text/javascript">
						$(document).ready(function() {
							$("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd", buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
						});
						</script>';
                break;
            case 'datetime':
                $this->SetDateTimeHtmlOptions($column);
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                echo '<script type="text/javascript">
						$(document).ready(function() {
							now = new Date();
							$("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(), buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
						});
						</script>';
                break;
            default:
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                break;
        }
    }
开发者ID:cebe,项目名称:chive,代码行数:55,代码来源:InputField.php



注:本文中的DataType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DataUtil类代码示例发布时间:2022-05-23
下一篇:
PHP DataSource类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap