*
* @return \OCP\DB\QueryBuilder\IFunctionBuilder
*/
- public function fun() {
+ public function func() {
if ($this->connection instanceof OracleConnection) {
return new OCIFunctionBuilder($this->helper);
} else if ($this->connection->getDatabasePlatform() instanceof SqlitePlatform) {
$sourceLength = strlen($sourcePath);
$query = $this->connection->getQueryBuilder();
- $fun = $query->fun();
+ $fun = $query->func();
$newPathFunction = $fun->concat(
$query->createNamedParameter($targetPath),
$fun->substring('path', $query->createNamedParameter($sourceLength + 1, IQueryBuilder::PARAM_INT))// +1 for the leading slash
public function testConcat() {
$query = $this->connection->getQueryBuilder();
- $query->select($query->fun()->concat($query->createNamedParameter('foo'), new Literal("'bar'")));
+ $query->select($query->func()->concat($query->createNamedParameter('foo'), new Literal("'bar'")));
$this->assertEquals('foobar', $query->execute()->fetchColumn());
}
public function testMd5() {
$query = $this->connection->getQueryBuilder();
- $query->select($query->fun()->md5($query->createNamedParameter('foobar')));
+ $query->select($query->func()->md5($query->createNamedParameter('foobar')));
$this->assertEquals(md5('foobar'), $query->execute()->fetchColumn());
}
public function testSubstring() {
$query = $this->connection->getQueryBuilder();
- $query->select($query->fun()->substring($query->createNamedParameter('foobar'), new Literal(2), $query->createNamedParameter(2)));
+ $query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2), $query->createNamedParameter(2)));
$this->assertEquals('oo', $query->execute()->fetchColumn());
}
public function testSubstringNoLength() {
$query = $this->connection->getQueryBuilder();
- $query->select($query->fun()->substring($query->createNamedParameter('foobar'), new Literal(2)));
+ $query->select($query->func()->substring($query->createNamedParameter('foobar'), new Literal(2)));
$this->assertEquals('oobar', $query->execute()->fetchColumn());
}