/**
  * Returns table name for given entity
  * @param $entityName
  * @return string
  */
 protected function _getTable($entityName)
 {
     return $this->_resource->getTableName($entityName);
 }
Пример #2
0
 /**
  * Class constructor
  *
  * @param array $arguments
  * @throws InvalidArgumentException
  */
 public function __construct(array $arguments = array())
 {
     if (isset($arguments['resource'])) {
         $this->_resources = $arguments['resource'];
     } else {
         $this->_resources = Mage::getSingleton('Mage_Core_Model_Resource');
     }
     if (!$this->_resources instanceof Mage_Core_Model_Resource) {
         throw new InvalidArgumentException('Argument "resource" is expected to be an instance of "Mage_Core_Model_Resource".');
     }
     parent::__construct();
 }
Пример #3
0
 /**
  * Class constructor
  */
 public function __construct()
 {
     $this->_resources = Mage::getSingleton('Mage_Core_Model_Resource');
     parent::__construct();
 }
Пример #4
0
 /**
  * Main constructor
  */
 public function __construct($data = array())
 {
     parent::__construct();
     $properties = get_object_vars($this);
     foreach ($data as $key => $value) {
         if (array_key_exists('_' . $key, $properties)) {
             $this->{'_' . $key} = $value;
         }
     }
 }
Пример #5
0
 /**
  * Class constructor
  *
  * @param array $arguments
  * @throws InvalidArgumentException
  */
 public function __construct(Mage_Core_Model_Resource $resource)
 {
     $this->_resources = $resource;
     parent::__construct();
 }