[ Politics ] Open question: Is Kathy Zhu a white supremacist who should be arrested and equipped with improved interrogation techniques until she agrees to change her views?

Just another privileged white girl. [TagsToTranslate] yahoo

The interrogation of the postgresql digest function in the procedure works on pgadmin but does not work by calling via Laravel

Recently, I created a stored procedure in Postgres Sql that deals with hashing passwords. When it is used via the PgAdmin tool, it works like a charm, as shown below.

I've also installed the pgcrypto extension.

SELECT horeca_user.update_token (
1, // user_id
1, // type
Token // sdsfsdfs & # 39;
)

It works when it is called via the pgadmin tool, but not in the laravel application as shown below.

$ token =  DB :: select ("SELECT * from " horeca_user  ". update_token (& # 39; $ type & # 39; $ user_id & # 39; $ token & # 39; ) ");

and finally it's my code of procedure

CREATE OR REPLACE FUNCTION horeca_user.update_token (integer tp, integer user-id, variant token character)
RETURNS character variant
LANGUAGE & # 39; plpgsql & # 39; VOLATILE
PARALLEL UNSAFE
COST 100
AS $ BODY $
DECLARE uid INTEGER;
DECLARE the variable tok character;
TO START
uid: = 0;
Select count (*) as the total of horeca_user.user_tokens where user_id = 2 $ in uid;

if uid = 0 THEN
Insert into horeca_user.user_tokens (id, user_id, tip), values ​​($ 3, $ 2, $ 1);
other
Update horeca_user.user_tokens set id = $ 3, tip = $ 1 where user_id = $ 2;
END IF;

SELECT encode (digest (token, 'sha256'), 'hex' as tt in tok;

back tok;
END

$ BODY $;

7 – Conditional clauses with Entity Interrogation field

I have a syntax problem on the use of conditional clauses with EFQ, but the documentation on drupal.org is a bit fuzzy. I've got google all over the internet for that without result at all. My hook implementation is based on another drupal.stackexchange issue

The code works for only one -> fieldCondition but when I try to implement the hook below,

                $ query = new EntityFieldQuery ();
$ entityFormSubmissionIds = $ query-> entityCondition ('entity_type', & # 39; entityform & # 39;)
-> addTag (& # 39; or & # 39;)
-> execute ();
$ entityform_ids = array_keys ($ entityFormSubmissionIds['entityform'])
$ submissionArray = entity_load (& # 39; entityform & # 39 ;, $ entityform_ids); `

/ **
Implements hook_query_TAG_alter

@param QueryAlterableInterface $ query
* /

$ or = db_or ();
$ query-> fieldCondition (& # 39; field_A1 & # 39 ;, & quot; tid & # 39 ;, $ my-> tid)
-> fieldCondition (& # 39; field_A2 & # 39 ;, & # 39; tid & # 39 ;, $ my-> tid)
-> fieldCondition (& # 39; field_B, & # 39; tid & # 39 ;, $ my-> tid)
-> fieldCondition (& # 39; field_C & # 39; tid; $ my-> tid);
$ query-> condition ($ or);

Fatal error: calling the undefined method DatabaseCondition :: fieldCondition () in line 705 of mymodule.module

line 705 is:

$ or = db_or ();

If you want more information, I will be glad to help you
thank you so much