Get parameter value in socialengine/zendframework $this->_getParam(‘id’, null) $this->getRequest()->getParam(‘fancybox’, null);
Tag: SocialEngine
check if subject is set in socialengine
Check one subject is set in socialengine if(Engine_Api::_()->core()->hasSubject()) { } We can use the above code is for avoiding multiple subject set in socialengine.
call view helper in api or plugin of socialengine
View property is not available in plugin .So call view property using zend and use this for get view helper $view = Zend_Registry::get(‘Zend_View’); $job_status = $view->getJobStatus(‘id’);
Pass custom error messages to form in socialengine / zend framework
if( !$form->isValid($this->getRequest()->getPost()) ) { return; } // Process $values = $form->getValues(); if( ($CouponCode = $form->getElement(‘coupon_code’)) && isset($values[‘coupon_code’])) { $iCouponExist = $table->checkCouponExist($values[‘coupon_code’]); if($iCouponExist == 1) { return $CouponCode->addError(‘This Coupon Code is not available, please use another one.’); } }
zend framework group by select in socialengine
$viewer = Engine_Api::_()->user()->getViewer(); $iCurUser = $viewer->getIdentity(); $oSelect = $this->getAdapter()->select() ->from(‘engine4_job_usersapplied’, array(‘job_id’, ‘COUNT(job_id) as applied_count’)) ->group(‘job_id’) ->where(‘job_user = ?’, $iCurUser); $result = $this->getAdapter()->fetchAll($oSelect);