当前位置: 首页>>代码示例>>PHP>>正文


PHP DataType类代码示例

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


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


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