Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit e6921e7

Browse files
committed
adding files from module creator
1 parent 2c4bf01 commit e6921e7

File tree

23 files changed

+1907
-321
lines changed

23 files changed

+1907
-321
lines changed

Magento1/app/code/community/Werules/Chatbot/Helper/Data.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,23 @@
2121

2222
class Werules_Chatbot_Helper_Data extends Mage_Core_Helper_Abstract
2323
{
24-
24+
/**
25+
* convert array to options
26+
*
27+
* @access public
28+
* @param $options
29+
* @return array
30+
* @author Ultimate Module Creator
31+
*/
32+
public function convertOptions($options)
33+
{
34+
$converted = array();
35+
foreach ($options as $option) {
36+
if (isset($option['value']) && !is_array($option['value']) &&
37+
isset($option['label']) && !is_array($option['label'])) {
38+
$converted[$option['value']] = $option['label'];
39+
}
40+
}
41+
return $converted;
42+
}
2543
}

Magento1/app/code/community/Werules/Chatbot/Model/Chatbotapi.php

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,82 @@
2121

2222
class Werules_Chatbot_Model_Chatbotapi extends Mage_Core_Model_Abstract
2323
{
24-
protected function _construct(){
24+
/**
25+
* Entity code.
26+
* Can be used as part of method name for entity processing
27+
*/
28+
const ENTITY = 'werules_chatbot_chatbotapi';
29+
const CACHE_TAG = 'werules_chatbot_chatbotapi';
2530

26-
$this->_init("chatbot/chatbotapi");
31+
/**
32+
* Prefix of model events names
33+
*
34+
* @var string
35+
*/
36+
protected $_eventPrefix = 'werules_chatbot_chatbotapi';
2737

38+
/**
39+
* Parameter name in event
40+
*
41+
* @var string
42+
*/
43+
protected $_eventObject = 'chatbotapi';
44+
45+
/**
46+
* constructor
47+
*
48+
* @access public
49+
* @return void
50+
* @author Ultimate Module Creator
51+
*/
52+
public function _construct()
53+
{
54+
parent::_construct();
55+
$this->_init('werules_chatbot/chatbotapi');
56+
}
57+
58+
/**
59+
* before save chatbotapi
60+
*
61+
* @access protected
62+
* @return Werules_Chatbot_Model_Chatbotapi
63+
* @author Ultimate Module Creator
64+
*/
65+
protected function _beforeSave()
66+
{
67+
parent::_beforeSave();
68+
$now = Mage::getSingleton('core/date')->gmtDate();
69+
if ($this->isObjectNew()) {
70+
$this->setCreatedAt($now);
71+
}
72+
$this->setUpdatedAt($now);
73+
return $this;
2874
}
2975

30-
}
76+
/**
77+
* save chatbotapi relation
78+
*
79+
* @access public
80+
* @return Werules_Chatbot_Model_Chatbotapi
81+
* @author Ultimate Module Creator
82+
*/
83+
protected function _afterSave()
84+
{
85+
return parent::_afterSave();
86+
}
87+
88+
/**
89+
* get default values
90+
*
91+
* @access public
92+
* @return array
93+
* @author Ultimate Module Creator
94+
*/
95+
public function getDefaultValues()
96+
{
97+
$values = array();
98+
$values['status'] = 1;
99+
return $values;
100+
}
101+
102+
}

Magento1/app/code/community/Werules/Chatbot/Model/Chatbotuser.php

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,82 @@
2121

2222
class Werules_Chatbot_Model_Chatbotuser extends Mage_Core_Model_Abstract
2323
{
24-
protected function _construct(){
24+
/**
25+
* Entity code.
26+
* Can be used as part of method name for entity processing
27+
*/
28+
const ENTITY = 'werules_chatbot_chatbotuser';
29+
const CACHE_TAG = 'werules_chatbot_chatbotuser';
2530

26-
$this->_init("chatbot/chatbotuser");
31+
/**
32+
* Prefix of model events names
33+
*
34+
* @var string
35+
*/
36+
protected $_eventPrefix = 'werules_chatbot_chatbotuser';
2737

38+
/**
39+
* Parameter name in event
40+
*
41+
* @var string
42+
*/
43+
protected $_eventObject = 'chatbotuser';
44+
45+
/**
46+
* constructor
47+
*
48+
* @access public
49+
* @return void
50+
* @author Ultimate Module Creator
51+
*/
52+
public function _construct()
53+
{
54+
parent::_construct();
55+
$this->_init('werules_chatbot/chatbotuser');
56+
}
57+
58+
/**
59+
* before save chatbotuser
60+
*
61+
* @access protected
62+
* @return Werules_Chatbot_Model_Chatbotuser
63+
* @author Ultimate Module Creator
64+
*/
65+
protected function _beforeSave()
66+
{
67+
parent::_beforeSave();
68+
$now = Mage::getSingleton('core/date')->gmtDate();
69+
if ($this->isObjectNew()) {
70+
$this->setCreatedAt($now);
71+
}
72+
$this->setUpdatedAt($now);
73+
return $this;
2874
}
2975

30-
}
76+
/**
77+
* save chatbotuser relation
78+
*
79+
* @access public
80+
* @return Werules_Chatbot_Model_Chatbotuser
81+
* @author Ultimate Module Creator
82+
*/
83+
protected function _afterSave()
84+
{
85+
return parent::_afterSave();
86+
}
87+
88+
/**
89+
* get default values
90+
*
91+
* @access public
92+
* @return array
93+
* @author Ultimate Module Creator
94+
*/
95+
public function getDefaultValues()
96+
{
97+
$values = array();
98+
$values['status'] = 1;
99+
return $values;
100+
}
101+
102+
}

Magento1/app/code/community/Werules/Chatbot/Model/Message.php

Lines changed: 75 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,82 @@
2121

2222
class Werules_Chatbot_Model_Message extends Mage_Core_Model_Abstract
2323
{
24-
protected function _construct(){
24+
/**
25+
* Entity code.
26+
* Can be used as part of method name for entity processing
27+
*/
28+
const ENTITY = 'werules_chatbot_message';
29+
const CACHE_TAG = 'werules_chatbot_message';
2530

26-
$this->_init("chatbot/message");
31+
/**
32+
* Prefix of model events names
33+
*
34+
* @var string
35+
*/
36+
protected $_eventPrefix = 'werules_chatbot_message';
2737

38+
/**
39+
* Parameter name in event
40+
*
41+
* @var string
42+
*/
43+
protected $_eventObject = 'message';
44+
45+
/**
46+
* constructor
47+
*
48+
* @access public
49+
* @return void
50+
* @author Ultimate Module Creator
51+
*/
52+
public function _construct()
53+
{
54+
parent::_construct();
55+
$this->_init('werules_chatbot/message');
56+
}
57+
58+
/**
59+
* before save message
60+
*
61+
* @access protected
62+
* @return Werules_Chatbot_Model_Message
63+
* @author Ultimate Module Creator
64+
*/
65+
protected function _beforeSave()
66+
{
67+
parent::_beforeSave();
68+
$now = Mage::getSingleton('core/date')->gmtDate();
69+
if ($this->isObjectNew()) {
70+
$this->setCreatedAt($now);
71+
}
72+
$this->setUpdatedAt($now);
73+
return $this;
2874
}
2975

30-
}
76+
/**
77+
* save message relation
78+
*
79+
* @access public
80+
* @return Werules_Chatbot_Model_Message
81+
* @author Ultimate Module Creator
82+
*/
83+
protected function _afterSave()
84+
{
85+
return parent::_afterSave();
86+
}
87+
88+
/**
89+
* get default values
90+
*
91+
* @access public
92+
* @return array
93+
* @author Ultimate Module Creator
94+
*/
95+
public function getDefaultValues()
96+
{
97+
$values = array();
98+
$values['status'] = 1;
99+
return $values;
100+
}
101+
102+
}

Magento1/app/code/community/Werules/Chatbot/Model/Mysql4/Chatbotapi.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

Magento1/app/code/community/Werules/Chatbot/Model/Mysql4/Chatbotapi/Collection.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

Magento1/app/code/community/Werules/Chatbot/Model/Mysql4/Chatbotuser.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)