Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>tags/v24.0.0beta2
public function charLength($field, $alias = ''): IQueryFunction { | public function charLength($field, $alias = ''): IQueryFunction { | ||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; | $alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; | ||||
$quotedName = $this->helper->quoteColumnName($field); | $quotedName = $this->helper->quoteColumnName($field); | ||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias); | |||||
return new QueryFunction('CHAR_LENGTH(' . $quotedName . ')' . $alias); | |||||
} | } | ||||
public function max($field): IQueryFunction { | public function max($field): IQueryFunction { |
$quotedName = $this->helper->quoteColumnName($field); | $quotedName = $this->helper->quoteColumnName($field); | ||||
return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias); | return new QueryFunction('LENGTHB(' . $quotedName . ')' . $alias); | ||||
} | } | ||||
public function charLength($field, $alias = ''): IQueryFunction { | |||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; | |||||
$quotedName = $this->helper->quoteColumnName($field); | |||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias); | |||||
} | |||||
} | } |
$quotedName = $this->helper->quoteColumnName($field); | $quotedName = $this->helper->quoteColumnName($field); | ||||
return new QueryFunction('LENGTH(CAST(' . $quotedName . ' as BLOB))' . $alias); | return new QueryFunction('LENGTH(CAST(' . $quotedName . ' as BLOB))' . $alias); | ||||
} | } | ||||
public function charLength($field, $alias = ''): IQueryFunction { | |||||
$alias = $alias ? (' AS ' . $this->helper->quoteColumnName($alias)) : ''; | |||||
$quotedName = $this->helper->quoteColumnName($field); | |||||
return new QueryFunction('LENGTH(' . $quotedName . ')' . $alias); | |||||
} | |||||
} | } |