Example #1
0
 /**
  * Load variable by code
  *
  * @param \Magento\Core\Model\Variable $object
  * @param string $code
  * @return $this
  */
 public function loadByCode(\Magento\Core\Model\Variable $object, $code)
 {
     if ($result = $this->getVariableByCode($code, true, $object->getStoreId())) {
         $object->setData($result);
     }
     return $this;
 }
Example #2
0
 public function testCollection()
 {
     $collection = $this->_model->getCollection();
     $collection->setStoreId(1);
     $this->assertEquals(1, $collection->getStoreId(), 'Store id setter and getter');
     $collection->addValuesToResult();
     $this->assertContains('core_variable_value', (string) $collection->getSelect());
 }