Exemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function resolve(&$value)
 {
     if (is_string($value) && strlen($value) > 0) {
         $value = \Phalcon\Text::upper($value);
     }
     return $value;
 }
 /**
  * Cast value to string
  * @param $value
  * @return string
  */
 public function cast($value)
 {
     if ($this->_trim === null && self::$_defaultTrim !== null) {
         $this->_trim = self::$_defaultTrim;
     }
     if (is_scalar($value)) {
         $value = (string) $value;
         if ($this->_trim === true) {
             $value = trim($value);
         }
         if ($this->_uppercase === true) {
             $value = \Phalcon\Text::upper($value);
         } elseif ($this->_lowercase === true) {
             $value = \Phalcon\Text::lower($value);
         }
         return $value;
     }
     return '';
 }
Exemplo n.º 3
0
 public static function upper($str)
 {
     return parent::upper($str);
 }
Exemplo n.º 4
0
 public static function upper($str, $encoding = "UTF-8")
 {
     return parent::upper($str, $encoding);
 }
Exemplo n.º 5
0
 public function testUpper()
 {
     $this->assertEquals(PhText::upper('hello'), 'HELLO');
     $this->assertEquals(PhText::upper('HELLO'), 'HELLO');
     $this->assertEquals(PhText::upper('1234'), '1234');
 }
Exemplo n.º 6
0
 public function describeReferences($table, $schema = null)
 {
     $table = $this->escape($table);
     $sql = 'SELECT AC.TABLE_NAME, CC.COLUMN_NAME, AC.CONSTRAINT_NAME, AC.R_OWNER, RCC.TABLE_NAME R_TABLE_NAME, ' . 'RCC.COLUMN_NAME R_COLUMN_NAME FROM ALL_CONSTRAINTS AC JOIN ALL_CONS_COLUMNS CC ' . 'ON AC.CONSTRAINT_NAME = CC.CONSTRAINT_NAME JOIN ALL_CONS_COLUMNS RCC ON AC.R_OWNER = RCC.OWNER ' . "AND AC.R_CONSTRAINT_NAME = RCC.CONSTRAINT_NAME WHERE AC.CONSTRAINT_TYPE='R' ";
     if (!empty($schema)) {
         $schema = $this->escapeSchema($schema);
         $sql .= 'AND AC.OWNER = ' . Text::upper($schema) . ' AND AC.TABLE_NAME = ' . Text::upper($table);
     } else {
         $sql .= 'AND AC.TABLE_NAME = ' . Text::upper($table);
     }
     return $sql;
 }
Exemplo n.º 7
0
 public function testUpperException()
 {
     $this->setExpectedException('\\Phalcon\\Exception');
     \Phalcon\Text::upper(false);
 }