We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Phalcon\Mvc\Model\Query::setType not work

  $m = new self ();
  $query = $m->getModelsManager ()->createBuilder ()->addFrom ( 'UserRoles' )->where ( 'UserID = :id:', array (
                    'id' => 1 
  ) )->inWhere ( 'RoleID', $roleIds )->getQuery ();
  $query->setType ( Query::TYPE_DELETE );
  $result = $query->execute ();

The query setType not work, It also returns select result. If this is a bug?

hi @happyybm that look fine but are you using cache? if it's true maybe is the problem. Check the source code of the Query::execute()

Good luck

Thanks, i have checked the source code ,it looks fine,and i'm not using any cache.

hi @happyybm that look fine but are you using cache? if it's true maybe is the problem. Check the source code of the Query::execute()

Good luck

mmm well problably is a bug. Create a new issue please on github