File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
lib/internal/Magento/Framework/Model/ResourceModel/Db Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -793,10 +793,15 @@ protected function saveNewObject(\Magento\Framework\Model\AbstractModel $object)
793793 */
794794 protected function updateObject (\Magento \Framework \Model \AbstractModel $ object )
795795 {
796- //quoting numeric values as strings may decrease query performance on some environments
797- $ condition = is_numeric ($ object ->getId ())
798- ? $ this ->getIdFieldName () . '= ' . (int ) $ object ->getId ()
799- : $ this ->getConnection ()->quoteInto ($ this ->getIdFieldName () . '=? ' , $ object ->getId ());
796+ $ tableDescription = $ this ->getConnection ()
797+ ->describeTable ($ this ->getMainTable ());
798+ $ preparedValue = $ this ->getConnection ()
799+ ->prepareColumnValue (
800+ $ tableDescription [$ this ->getIdFieldName ()],
801+ $ object ->getId ()
802+ );
803+ $ condition = $ this ->getIdFieldName () . '= ' . $ preparedValue ;
804+
800805 /**
801806 * Not auto increment primary key support
802807 */
You can’t perform that action at this time.
0 commit comments