Questions tagged [createcommand]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
143 views

Any ./craft command throws error

When I attempt to run any ./craft it throws an error, for example: $ ./craft resave/entries Exception 'yii\base\UnknownMethodException' with message 'Calling unknown method: craft\console\Request::...
2
votes
1answer
417 views

Impossible to access an attribute (“created_at”) on a boolean variable (“1”)

I have read a number of related threads but am still puzzled what this error actually means or how to fix it. This triggers the error: <div class="twitter"> {% set tweets = ...
1
vote
1answer
59 views

Building a DbCommand to compare two columns on Variants

I am trying to compare two fields located on Variants in Commerce. One is the price field and then I also have an original price field which is a custom field. I want to compare and get all variants ...
1
vote
1answer
137 views

How to use alterColumn to change the values of an ENUM field in a DB Migration

I need to add a value to my plugin database for an ENUM field but I am struggling to find the correct syntax for the alterColumn method. I want to do this but with alterColumn if possible? ALTER ...
0
votes
1answer
345 views

Anyone have a createCommand example?

So I am using a plugin to import data and it isn't assigning the values (asset is inside of Matrix) so I am going to modify the plugin and add code to lookup values that I need to assign to ...
1
vote
0answers
78 views

How to update a matrix field for an entry with craft()->db->createCommand()?

Is it possible to update a matrix field for a know entry id and a known matrixfield id with craft()->db->createCommand(). The matrixfield has 3 fields as follows: time (already set - category ...
2
votes
1answer
907 views

createCommand sql query not working in plugin

Hi I have a plugin which I am running an sql statement from. $users = craft()->db->createCommand("SELECT craft_users.id as userId, craft_users.firstName, craft_users.lastName, craft_users.email ...