1
votes

I have a table named 'user'.I need to update the field 'email' .Is there any custom build queries for updating.I have only the uid of user.

I mean.. Is there any TYPO3 custom queries equivalent to

Update table 'user' set email = '[email protected]' where uid = 1;

like

$query = $this->createQuery(); $query->matching( $query->logicalAnd( $query->equals('organization', $organization), $query->contains('regions', $region) ) ) return $query->execute();

2
Is this like, you want to update a record say whose uid is fetched with findByUid() ??? Then better you use setter function for the corresponding field. - Anu Bhuvanendran Nair
After setting the field with a setter, simply invoke update too. You got what I meant, right ?? - Anu Bhuvanendran Nair
@AnuBhuvanendranNair You are right... - Aswathy S
No problem. Keep up your quick response.That'll be helpful for other solution seekers. - Anu Bhuvanendran Nair

2 Answers

2
votes

if you use extbase , you can use :

$object = $this->yourRepository->yourQuery();
$object->setEmail('[email protected]');
$this->yourRepository->update($object);
0
votes

Why don't you use

use HDNET\ExtensionName\Utility;

Utility::exec_UPDATEquery   (
    $table,
    $where,
    $fields_values,
    $no_quote_fields = false 
);

Please refer exec_UPDATEquery From TYPO3