Use this function to check the logged user is a friend of any other user. Here Viewer is logged user object and user is the one who want to check. $viewer->membership()->getRow($user);
Category: SocialEngine
SocialEngine tutorials, SocialEngine tips,SocialEngine plugins,SocialEngine modules
select query cannot join with another table zend framework
$select = $table->select() ->setIntegrityCheck(false) ->from($tableName) ->joinRight($subtableName, ‘`’.$subtableName.’`.`user_id` = `’.$tableName.’`.`user_id`’,array(‘resource_approved’,’user_approved’)) ->where(‘`’.$subtableName.’`.`resource_id` = ?’, $resource->getIdentity()); Give the following sql statement for avoid “select query cannot join with another table zend framework” mysql error. setIntegrityCheck(false)
session in socialengine
socialengine basically using zendframework for development. Zendframework methods can see all through the socialengine code. Session is an important functionality in programming. For achieving the session in socialengine use the following code $session = new Zend_Session_Namespace(‘invite’); $session->invite_code = $this->_getParam(‘code’); $session->invite_email = $this->_getParam(’email’);
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.’); } }