Permalink
Browse files

Dev: sid in SurveyDynamic and TokenDynamic are static …

  • Loading branch information...
Shnoulle committed Oct 6, 2018
1 parent fd7911f commit 6bb4566a41c46c55d8da8ee595a005d3d5cd5f38
@@ -188,8 +188,9 @@ public function tableName()
* @return int
*/
public function getSurveyId() {
return $this->dynamicId;
return $this->getDynamicId();
}
public function browse()
{
}
@@ -919,6 +919,6 @@ public function getPrintAnswersArray($sSRID, $sLanguage, $bHonorConditions = fal
* @return int
*/
public function getSurveyId() {
return $this->sid;
return self::$sid;
}
}
@@ -385,6 +385,6 @@ public function tableName()
* @return int
*/
public function getSurveyId() {
return $this->dynamicId;
return $this->getDynamicId();
}
}
@@ -1019,6 +1019,6 @@ public function search()
* @return int
*/
public function getSurveyId() {
return $this->sid;
return self::$sid;
}
}
@@ -45,31 +45,35 @@ public function beforeSave(CModelEvent $event)
* @param string $what
* @return PluginEvent the dispatched event
*/
private function _dispatchDynamic($when,$what) {
if(is_subclass_of($this->owner,'Dynamic'))
{
$oPluginEvent = new PluginEvent($when.get_parent_class($this->owner).$what, $this);
$oPluginEvent->set('model', $this->owner);
$oPluginEvent->set('dynamicId', $this->owner->getDynamicId());
return App()->getPluginManager()->dispatchEvent($oPluginEvent);
private function _dispatchDynamic($when,$what)
{
if(is_subclass_of($this->owner,'Dynamic')) {
$params = array(
'dynamicId' => $this->owner->getDynamicId()
);
return $this->dispatchPluginModelEvent($when.get_parent_class($this->owner).$what,null,$params);
}
}
/**
* method for dispatching plugin events
*
* See {@link find()} for detailed explanation about $condition and $params.
* @param string $sEventName event name to dispatch
* @param array $criteria array containing attributes, conditions and params for the filter query
* @param array $criteria array containing attributes, conditions and params for the filter query
* @param array $eventParams array of params for event
* @return PluginEvent the dispatched event
*/
public function dispatchPluginModelEvent($sEventName, $criteria = null)
public function dispatchPluginModelEvent($sEventName, $criteria = null, $eventParams = array())
{
$oPluginEvent = new PluginEvent($sEventName, $this);
$oPluginEvent->set('model', $this->owner);
if(method_exists($this->owner,'getSurveyId')) {
$oPluginEvent->set('iSurveyID', $this->owner->getSurveyId());
$oPluginEvent->set('surveyId', $this->owner->getSurveyId());
}
foreach($eventParams as $param => $value) {
$oPluginEvent->set($param, $value);
}
if (isset($criteria)) {
$oPluginEvent->set('filterCriteria', $criteria);
}

1 comment on commit 6bb4566

@Shnoulle

This comment has been minimized.

Collaborator

Shnoulle commented on 6bb4566 Oct 7, 2018

Never work on week-end …

Please sign in to comment.