Since: 3.1
Inheritance: extends Prado\TComponent
Example #1
0
 /**
  * Overrides parent implementation. Only column of type text or character (and its variants)
  * accepts the LIKE criteria.
  * @param array list of column id for potential search condition.
  * @param string string of keywords
  * @return string SQL search condition matching on a set of columns.
  */
 public function getSearchExpression($fields, $keywords)
 {
     $columns = array();
     foreach ($fields as $field) {
         if ($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) {
             $columns[] = $field;
         }
     }
     return parent::getSearchExpression($columns, $keywords);
 }
Example #2
0
 protected function applyParameterMap($manager, $command, $prepared, $statement, $parameterObject)
 {
     $properties = $prepared->getParameterNames(false);
     //$parameters = $prepared->getParameterValues();
     $registry = $manager->getTypeHandlers();
     if ($properties) {
         for ($i = 0, $k = $properties->getCount(); $i < $k; $i++) {
             $property = $statement->parameterMap()->getProperty($i);
             $value = $statement->parameterMap()->getPropertyValue($registry, $property, $parameterObject);
             $dbType = $property->getDbType();
             if ($dbType == '') {
                 //relies on PHP lax comparison
                 $command->bindValue($i + 1, $value, TDbCommandBuilder::getPdoType($value));
             } else {
                 if (strpos($dbType, 'PDO::') === 0) {
                     $command->bindValue($i + 1, $value, constant($property->getDbType()));
                 } else {
                     $command->bindValue($i + 1, $value);
                 }
             }
         }
     }
 }