Questions tagged [orm]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
35 views

using sql queries is good practice in magento 2

using SQL queries is good practice in Magento 2 over ORM which is best one to while customizing 1)Security 2)Speed ORM vs SQL queries which one giving Security and speed while ...
0
votes
2answers
36 views

How to resolve the “Direct object instantiation (object of \Zend_Db_Expr) is discouraged in Magento 2”?

I am getting warning as "Direct object instantiation (object of \Zend_Db_Expr) is discouraged in Magento2" when I did MEQP2. Please anyone can help me to resolve this warning. I am getting ...
1
vote
1answer
32 views

Magento 1.9.x ORM query to get past successful orders with specific billing street, city, state and zip

I need an ORM query to get all past successful orders with a specific billing street address, city, state and zip code? ie: $street = '999 west rd'; $city = 'my town'; $state = 'New York'; $zip = '...
1
vote
0answers
48 views

SQL Functions at magento

I need to write a question use Magento ORM applying functions at condition like this: SELECT * WHERE REPLACE(street, ' ', '') = 'Streetac'. I try using regular expressions but I have problem with ...
3
votes
2answers
1k views

Magento\Framework\Exception\NoSuchEntityException when updating products

I am Trying to update product programmatically magento2 Magento ver. 2.1.2 Hear is my code require 'vendor/autoload.php'; use Magento\Framework\App\Bootstrap; include('app/bootstrap.php'); $...
1
vote
0answers
95 views

Load products without category association

I've been looking for a way to load products without a category in Magento2. I'm working on a cleanup script that will automatically assign them to a relevant category, but at a loss implementing the ...
4
votes
1answer
1k views

How do I specify unique constraint for multiple columns in InstallSchema.php?

In the InstallSchema.php, I would like to add an unique contraint on a combination of column. In SQL, it would be done with this request: ALTER TABLE `linked_cities` ADD UNIQUE `unique_index`(`...
2
votes
2answers
113 views

What methods typically go in Model, Resource and Collection

I'm fairly new to Magento, coming from a Symfony/Laravel background. Magento's ORM implementation seems a bit confusing at first. Most resource/collection classes only seem to have a _construct() ...
1
vote
1answer
268 views

Magento 2: links between entities: best practices

I have a question regarding link between entities. Consider that a car is linked to a brand. The car entity will have a brand_Id attribute. Coming from the "Symfony universe", using the Doctrine ORM, ...
-1
votes
1answer
71 views

Is it possible to implement model inheritance in magento?

For example I have Question model and Reply model. Both of them have methods with same names and similar functionality like isDeclined, isSeen etc. As it already extends Mage_Core_Model_Abstract how ...
0
votes
1answer
2k views

Get order data by product id Magento 1.9

i want to get all data (order_id , Bill to Name , ship to Name , BaseGrandTotal , GrandTotal ,Status ) about order with the known of product ids Here is the sample of my code $ids=array(); ...
6
votes
4answers
7k views

How to get product collections by set of ids in magento 2?

I wanna something like "IN CLAUSE" in MYSQL using by magento2 ORM, something like this: select * from product where id in (...) but by using collection in magento 2? for example something like this:...
0
votes
1answer
213 views

Magento orm model and direct SQL query

I am little bit confuse. I am using magento orm basic like Mage::getModel('test/test') and I search that also use direct SQL query use for insert,update and delete so my question is which one is ...
4
votes
2answers
1k views

Magento 2 CRUD Models: Create and Update Time

I've created a Magento 2 CRUD/Abstract model that updates the following MySQL table. CREATE TABLE `pulsestorm_commercebug_log` ( `pulsestorm_commercebug_log_id` int(10) unsigned NOT NULL ...