for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace MartinGeorgiev\Doctrine\ORM\Query\AST\Functions;
/**
* Implementation of PostgreSQL check if left side contains right side (using @>).
*
* @see https://www.postgresql.org/docs/9.4/static/functions-array.html
* @since 0.1
* @author Martin Georgiev <[email protected]>
* @example Using it in DQL with boolean comparison: "WHERE CONTAINS(e.tags, ARRAY[:tags]) = TRUE"
* Returns boolean, must be used with "= TRUE" or "= FALSE" in DQL.
*/
class Contains extends BaseFunction
{
protected function customizeFunction(): void
$this->setFunctionPrototype('(%s @> %s)');
$this->addNodeMapping('StringPrimary');
}