_init('revslider/animation', 'id'); } public function loadByName(AM_RevSlider_Model_Animation $animation, $name){ if (!$name) return $animation; $adapter = $this->_getReadAdapter(); $bind = array('name' => $name); $select = $adapter->select() ->from($this->getMainTable(), array($this->getIdFieldName())) ->where('name = :name'); $animationId = $adapter->fetchOne($select, $bind); if ($animationId){ $animation->load($animationId); }else{ $animation->setData(array()); } return $animation; } }