当前位置: 首页>>代码示例>>PHP>>正文


PHP Profile::getName方法代码示例

本文整理汇总了PHP中Profile::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP Profile::getName方法的具体用法?PHP Profile::getName怎么用?PHP Profile::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profile的用法示例。


在下文中一共展示了Profile::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: update

 public function update(Profile $O_profile)
 {
     if (!is_null($O_profile->getId())) {
         if (!$O_profile->getName() || !$O_profile->getSlug() || !$O_profile->getLevel()) {
             throw new Exception("Des informations obligatoires sont manquantes, nous ne pouvons pas mettre à jour le profile");
         }
         $I_id = $O_profile->getId();
         $S_name = $O_profile->getName();
         $S_sql = 'UPDATE profile SET name = ? WHERE id = ?';
         $A_params = array($S_name, $I_id);
         $O_connection = new Connection();
         if ($A_data = $O_connection->requestDb($S_sql, $A_params)) {
             return true;
         }
     }
     return false;
 }
开发者ID:Vincent-Troccaz,项目名称:safety,代码行数:17,代码来源:ProfileMapper.php

示例2: cloneProfile

 static function cloneProfile(Profile $prof)
 {
     $plugprof = new self();
     if ($plugprof->getFromDB($prof->input['_old_id'])) {
         $input = ToolBox::addslashes_deep($plugprof->fields);
         $input['profile'] = ToolBox::addslashes_deep($prof->getName());
         $input['id'] = $prof->getID();
         $plugprof->add($input);
     }
 }
开发者ID:geldarr,项目名称:hack-space,代码行数:10,代码来源:profile.class.php

示例3: executeProfile

 public static function executeProfile(Profile $profile, AbstractEyeosUser $user)
 {
     $path = SYSTEM_SKEL_PATH . '/' . USERS_DIR . '/profiles/' . utf8_basename($profile->getName()) . '/scripts/';
     $directory = new DirectoryIterator($path);
     foreach ($directory as $fileInfo) {
         $fileInfoName = $fileInfo->getFileName();
         if (!$fileInfo->isDot() && $fileInfoName != '.svn') {
             require_once $path . $fileInfoName;
         }
     }
 }
开发者ID:DavidGarciaCat,项目名称:eyeos,代码行数:11,代码来源:profile.php

示例4: viewAll

 /**
  * View all users connections
  * @param int $user
  * @return void
  */
 private function viewAll($user)
 {
     if ($this->registry->getObject('authenticate')->isLoggedIn()) {
         require_once FRAMEWORK_PATH . 'models/relationships.php';
         $relationships = new Relationships($this->registry);
         $all = $relationships->getByUser($user, false, 0);
         $this->registry->getObject('template')->buildFromTemplates('header.tpl.php', 'friends/all.tpl.php', 'footer.tpl.php');
         $this->registry->getObject('template')->getPage()->addTag('all', array('SQL', $all));
         require_once FRAMEWORK_PATH . 'models/profile.php';
         $p = new Profile($this->registry, $user);
         $name = $p->getName();
         $this->registry->getObject('template')->getPage()->addTag('connecting_name', $name);
     } else {
         $this->registry->errorPage('Please login', 'Please login to view a users connections');
     }
 }
开发者ID:simontakite,项目名称:cookbooks,代码行数:21,代码来源:controller.php

示例5: commonTemplateTags

 /**
  * Set common template tags for all profile aspects
  * @param int $user the user id
  * @return void
  */
 private function commonTemplateTags($user)
 {
     // get a random sample of 6 friends.
     require_once FRAMEWORK_PATH . 'models/relationships.php';
     $relationships = new Relationships($this->registry);
     $cache = $relationships->getByUser($user, true, 6);
     $this->registry->getObject('template')->getPage()->addTag('profile_friends_sample', array('SQL', $cache));
     // get the name and photo of the user
     require_once FRAMEWORK_PATH . 'models/profile.php';
     $profile = new Profile($this->registry, $user);
     $name = $profile->getName();
     $photo = $profile->getPhoto();
     $uid = $profile->getID();
     $this->registry->getObject('template')->getPage()->addTag('profile_name', $name);
     $this->registry->getObject('template')->getPage()->addTag('profile_photo', $photo);
     $this->registry->getObject('template')->getPage()->addTag('profile_user_id', $uid);
     // clear the profile
     $profile = "";
 }
开发者ID:simontakite,项目名称:cookbooks,代码行数:24,代码来源:controller.php

示例6: filterMemberIdByProfile

 public function filterMemberIdByProfile($ids, $column, $value, Profile $item, $publicFlag = 1)
 {
     $_result = array();
     $q = Doctrine::getTable('MemberProfile')->createQuery('m');
     $q = opFormItemGenerator::filterSearchQuery($q, 'm.' . $column, $value, $item->toArray())->select('m.member_id')->andWhere('m.profile_id = ?', $item->getId());
     $isCheckPublicFlag = is_integer($publicFlag);
     if (!$item->getIsEditPublicFlag()) {
         if (ProfileTable::PUBLIC_FLAG_SNS == $item->getDefaultPublicFlag() || ProfileTable::PUBLIC_FLAG_WEB == $item->getDefaultPublicFlag()) {
             $isCheckPublicFlag = false;
         } else {
             return array();
         }
     }
     if ($isCheckPublicFlag) {
         $publicFlags = (array) $publicFlag;
         if (1 == $publicFlag) {
             $publicFlags[] = 4;
         }
         if ($item->isMultipleSelect() && 'date' !== $item->getFormType()) {
             $q->addFrom('MemberProfile pm')->andWhere('m.tree_key = pm.id')->andWhereIn('pm.public_flag', $publicFlags);
         } else {
             $q->andWhereIn('m.public_flag', $publicFlags);
         }
     }
     $list = $q->execute();
     foreach ($list as $v) {
         $_result[] = $v->getMemberId();
     }
     if (is_array($ids)) {
         $ids = array_values(array_intersect($ids, $_result));
     } else {
         $ids = array_values($_result);
     }
     if ($isCheckPublicFlag && 'op_preset_birthday' === $item->getName()) {
         if ('%-' !== substr($value, 0, 2)) {
             $ids = $this->filterMemberIdsByAgePublicFlag($ids);
         }
     }
     return $ids;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:40,代码来源:MemberProfileTable.class.php

示例7: add

 /**
  * @param Profile $profile
  */
 public function add(Profile $profile)
 {
     $this->profiles[$profile->getName()] = $profile;
 }
开发者ID:kachkaev,项目名称:php-backup,代码行数:7,代码来源:ProfileRegistry.php

示例8: viewAll

 private function viewAll($user)
 {
     if ($this->registry->getObject('authenticate')->isLoggedIn() == true) {
         $rel = new RelationsGet($this->registry);
         $all = $rel->getByUser($user, false, 0);
         $this->registry->getObject('template')->buildFromTemplate('header.php', 'relations_all.php', 'footer.php');
         //echo $all;
         $this->registry->getObject('template')->getPage()->addTag('all', array('SQL', $all));
         $profile = new Profile($this->registry, $user);
         $name = $profile->getName();
         $this->registry->getObject('template')->getPage()->addTag('connecting_name', $name);
     } else {
         $this->registry->errorPage('Error', 'Please Login to view connections');
     }
 }
开发者ID:maxzeroedge,项目名称:social,代码行数:15,代码来源:relateController.php

示例9: User

// Law of Demter (Tell, Don't Ask!)
//
//
// The method on an object is allowed to interact with the following:
//
//  1. Other methods on its object;
//  2. Methods on properties of the object;
//  3. Methods on arguments passed into the method;
//  4. Methods on instances of new objects, created inside of the method.
include "User.php";
include "Profile.php";
/**
 * If we want to get the user's name, through the Profile object,
 * it should TELL the name, not ASK for it a third party object,
 * in our case the User object.
 *
 * So, without the law of Demeter in mind, the code would look like this:
 */
$user = new User("Josh", 29);
$userProfile = new Profile($user, "/img/josh.jpg");
echo $userProfile->getUser()->getName();
/**
 * In the above example, we ASK the User object to give us it's name.
 *
 * Now, we'll make the Profile object TELL the user's name:
 */
echo $userProfile->getName();
/**
 * The above row is the law of Demeter in action.
 */
开发者ID:brslv,项目名称:code,代码行数:30,代码来源:index.php


注:本文中的Profile::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。