getConfig('shortBioLength')); } protected function _prepareList(&$list) { parent::_prepareList($list); foreach ($list as &$row) { if (empty($row['shortBio'])) { $row['shortBio'] = $this->_getShortBio($row); } } return $this; } public function getObjectInfo() { if (($info = parent::getObjectInfo())) { $info['itemTitle'] = $info['name']; } return $info; } protected function _addDependenciesFromDb(array &$data) { $this->_addSocialLinks($data); return parent::_addDependenciesFromDb($data); } protected function _addSocialLinks(&$data) { $ownSocialLinks = $this->_getOwnSocialLinks(); if ($ownSocialLinks) { $data['socialLinks'] = $ownSocialLinks; } return $this; } /** * return current member social links * * @return array */ protected function _getOwnSocialLinks() { $select = $this->_db->select(); $select->from($this->_getPair('PeopleSocialLink', 'psl'), ['link', 'linkId']) ->where('`peopleId` = ?', $this->_primaryKey, \Qs_Db::INT_TYPE) ->join( $this->_getPair('SocialLinkDictionary', 'sld'), '`sld`.`id` = `psl`.`linkId`', ['iconName', 'serviceName'] ) ->order('sld.sorter'); return $this->_db->fetchAll($select); } /** * returns social links from dictionary * * @return array */ public static function getSocialLinks() { $select = \Qs_Db::getSelect(); $select->from(\Qs_Db::getPair('SocialLinkDictionary')) ->where('`show` = "y"') ->order('sorter'); return \Qs_Db::getInstance()->fetchAll($select); } }