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


PHP self::populate方法代码示例

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


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

示例1: reorder

 /**
  * Reorder macro
  */
 public function reorder($from, $to)
 {
     $from = preg_replace('/[^0-9a-z_A-Z- \\.]/', '', $from);
     $to = preg_replace('/[^0-9a-z_A-Z- \\.]/', '', $to);
     $barcodeMacroFrom = new self();
     $barcodeMacroFrom->name = $from;
     $barcodeMacroFrom->populate();
     if (!strlen($barcodeMacroFrom->macro) > 0) {
         return;
     }
     $barcodeMacroTo = new self();
     $barcodeMacroTo->name = $to;
     $barcodeMacroTo->populate();
     if (!strlen($barcodeMacroTo->macro) > 0) {
         return;
     }
     $db = Zend_Registry::get("dbAdapter");
     $db->beginTransaction();
     try {
         $orderFrom = $barcodeMacroFrom->order;
         $barcodeMacroFrom->order = $barcodeMacroTo->order;
         $barcodeMacroFrom->persist();
         $barcodeMacroTo->order = $orderFrom;
         $barcodeMacroTo->persist();
         $db->commit();
     } catch (Exception $e) {
         $db->rollBack();
         trigger_error($e->getMessage(), E_USER_NOTICE);
     }
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:33,代码来源:BarcodeMacro.php

示例2: check_login

 public function check_login($username = '', $password = '', $type = 1)
 {
     $query = $this->db->get_where($this::DB_TABLE, array('username' => $username, 'password' => $password, 'type' => $type), 1);
     $user = new self();
     $user->populate($query->row());
     return $query->row() ? $user : false;
 }
开发者ID:syedashadi,项目名称:Magazines,代码行数:7,代码来源:my_user.php

示例3: plant

 public static function plant($mixedId, $mixedKind = "WP_Post", $dataset = array())
 {
     $tree = new self();
     $tree->setQuerier(Strata::I18n()->query());
     $tree->setContext($mixedId, $mixedKind);
     $tree->populate($dataset);
     return $tree;
 }
开发者ID:francoisfaubert,项目名称:strata-polyglot,代码行数:8,代码来源:Tree.php

示例4: loadQuestion

 /**
  * Handles loading a question, populating it with the given data
  * 
  * This will return a clean copy of the plugin, populated with the values
  * from the data array
  * 
  * @param array $data
  * @return \self
  */
 public function loadQuestion($data)
 {
     $question = new self($this->pluginManager, $this->id);
     $question->populate($data);
     $question->isQuestion(true);
     // Signal this is not the plugin, but a question object
     return $question;
 }
开发者ID:mfavetti,项目名称:LimeSurvey,代码行数:17,代码来源:QuestionPluginAbstract.php

示例5: fetch

 public static function fetch($pidm, $aid_year)
 {
     $statuses = array();
     $rset = self::get_status($pidm, $aid_year);
     foreach ($rset as $row) {
         $status = new self();
         $status->populate($row);
         $statuses[] = $status;
     }
     return $statuses;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:11,代码来源:Status.php

示例6: make

 public function make(array $array)
 {
     $return = array();
     foreach ($array as $k => $v) {
         if (Arrays::is($v)) {
             $o = new self();
             $return[$k] = $o->populate($v);
         } else {
             $return[$k] = $v;
         }
     }
     return $return;
 }
开发者ID:noikiy,项目名称:inovi,代码行数:13,代码来源:Container.php

示例7: generateVitalSignsTemplateKeyValue

 public static function generateVitalSignsTemplateKeyValue($vitalSignTemplateId = 1)
 {
     $vitalSignTemplate = new self();
     $vitalSignTemplate->vitalSignTemplateId = $vitalSignTemplateId;
     $vitalSignTemplate->populate();
     $vitals = array();
     try {
         $template = new SimpleXMLElement($vitalSignTemplate->template);
         foreach ($template as $vital) {
             $title = (string) $vital->attributes()->title;
             $vitals[$title] = (string) $vital->attributes()->label;
         }
     } catch (Exception $e) {
         WebVista::debug($e->getMessage());
     }
     return $vitals;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:17,代码来源:VitalSignTemplate.php

示例8: persist

 public function persist()
 {
     $visit = new self();
     $visit->visitId = $this->encounter_id;
     $visit->populate();
     $oldClosed = $visit->closed;
     $ret = parent::persist();
     $newClosed = $this->closed;
     if ($newClosed) {
         $newClaim = false;
         if ($newClosed && $oldClosed !== $newClosed && !ClaimLine::mostRecentClaim($this->encounter_id, true) > 0) {
             // recalculate claim lines if closed visit is new/reopened
             $newClaim = true;
         }
         $ret = self::recalculateClaims($this, $newClaim);
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:18,代码来源:Visit.php

示例9: populate

 public function populate(array $datas, $namespace = null)
 {
     if (null !== $namespace) {
         if (!isset($this->{$namespace})) {
             $this->{$namespace} = array();
         }
         foreach ($datas as $k => $v) {
             if (Arrays::is($k)) {
                 $this->populate($k, $namespace);
             } else {
                 $this->{$namespace} = array_merge($this->{$namespace}, array($k => $v));
             }
         }
     } else {
         foreach ($datas as $k => $v) {
             if (Arrays::is($v)) {
                 $o = new self();
                 $o->populate($v);
                 $this->{$k} = $o;
             } else {
                 $this->{$k} = $v;
             }
             if (!Arrays::inArray($k, $this->_fields)) {
                 $this->_fields[] = $k;
             }
         }
     }
     return $this;
 }
开发者ID:noikiy,项目名称:inovi,代码行数:29,代码来源:Object.php

示例10: instance

 public static function instance(array $data)
 {
     $object = new self();
     $object->populate($data);
     return $object;
 }
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:6,代码来源:class-wp-stream-record.php

示例11: refillRequestDatasourceHandler

 public static function refillRequestDatasourceHandler(Audit $auditOrm, $eachTeam = true)
 {
     $ret = array();
     if ($auditOrm->objectClass != 'MedicationRefillRequest') {
         WebVista::debug('Audit:objectClass is not MedicationRefillRequest');
         return $ret;
     }
     $orm = new self();
     $orm->messageId = $auditOrm->objectId;
     if (!$orm->populate()) {
         WebVista::debug('Failed to populate');
         return $ret;
     }
     $objectClass = get_class($orm);
     $messaging = new Messaging();
     $messaging->messagingId = $orm->messageId;
     $messaging->populate();
     $medicationId = (int) $orm->medicationId;
     $providerId = (int) $messaging->providerId;
     $personId = (int) $messaging->personId;
     //if (!$personId > 0 || !$medicationId > 0) {
     if (!$personId > 0) {
         WebVista::debug('Refill request needs manual matching');
         return $ret;
     }
     $patient = new Patient();
     $patient->personId = $personId;
     $patient->populate();
     $teamId = (string) $patient->teamId;
     $alert = new GeneralAlert();
     $alertTable = $alert->_table;
     $msgTable = $messaging->_table;
     $db = Zend_Registry::get('dbAdapter');
     $sqlSelect = $db->select()->from($msgTable, null)->join($alertTable, $alertTable . '.objectId = ' . $msgTable . '.messagingId')->where($msgTable . '.objectType = ?', Messaging::TYPE_EPRESCRIBE)->where($msgTable . '.messageType = ?', 'RefillRequest')->where("{$alertTable}.status = 'new'")->where($alertTable . '.objectClass = ?', $objectClass)->where($alertTable . '.userId = ?', $providerId)->where($msgTable . '.personId = ?', $personId)->limit(1);
     if ($eachTeam) {
         $sqlSelect->where($alertTable . '.teamId = ?', $teamId);
     }
     $alert->populateWithSql($sqlSelect->__toString());
     $messages = array();
     if ($alert->generalAlertId > 0) {
         // existing general alert
         $messages[] = $alert->message;
     } else {
         // new general alert
         $alert->urgency = 'High';
         $alert->status = 'new';
         $alert->dateTime = date('Y-m-d H:i:s');
         $alert->objectClass = $objectClass;
         $alert->objectId = $auditOrm->objectId;
         $alert->userId = (int) $providerId;
         if ($eachTeam) {
             $alert->teamId = $teamId;
         }
     }
     $messages[] = 'Refill request pending. ' . $orm->details;
     $alert->message = implode("\n", $messages);
     return $alert->toArray();
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:58,代码来源:MedicationRefillRequest.php

示例12: populate

 public function populate(array $datas, $namespace = null)
 {
     if (null !== $namespace) {
         if (!isset($this->{$namespace})) {
             $this->{$namespace} = [];
         }
         foreach ($datas as $k => $v) {
             if (Arrays::is($k)) {
                 $this->populate($k, $namespace);
             } else {
                 $this->{$namespace} = array_merge($this->{$namespace}, [$k => $v]);
             }
         }
     } else {
         foreach ($datas as $k => $v) {
             $id = isAke($datas, 'id', false);
             if (Arrays::is($v) && false === $id) {
                 if (Arrays::isAssoc($v)) {
                     $o = new self();
                     $o->populate($v);
                     $this->{$k} = $o;
                 } else {
                     $this->{$k} = $v;
                 }
             } else {
                 $this->{$k} = $v;
             }
             if (!Arrays::in($k, $this->_fields)) {
                 $this->_fields[] = $k;
             }
         }
     }
     return $this;
 }
开发者ID:schpill,项目名称:thin,代码行数:34,代码来源:Object.php

示例13: factory

 public static function factory($orderId)
 {
     $orm = new self();
     $orm->orderId = (int) $orderId;
     $orm->populate();
     if ($orm->type == self::TYPE_LAB_TEST) {
         $ormObj = new OrderLabTest();
         $ormObj->orderId = $orm->orderId;
         $ormObj->populate();
     } else {
         if ($orm->type == self::TYPE_IMAGING) {
             $ormObj = new OrderImaging();
             $ormObj->orderId = $orm->orderId;
             $ormObj->populate();
         } else {
             $ormObj = $orm;
         }
     }
     return $ormObj;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:20,代码来源:Order.php

示例14: getAttending

 public static function getAttending($teamId)
 {
     $name = TeamMember::ENUM_PARENT_NAME;
     $enumeration = new Enumeration();
     $enumeration->populateByUniqueName($name);
     $enumerationsClosure = new EnumerationsClosure();
     $rowset = $enumerationsClosure->getAllDescendants($enumeration->enumerationId, 1);
     $ret = 0;
     foreach ($rowset as $row) {
         if ($teamId == $row->key) {
             $attendings = $enumerationsClosure->getAllDescendants($row->enumerationId, 1);
             foreach ($attendings as $attending) {
                 $teamMember = new self();
                 $teamMember->teamMemberId = (int) $attending->ormId;
                 $teamMember->populate();
                 $ret = $teamMember->personId;
                 break 2;
             }
         }
     }
     return $ret;
 }
开发者ID:dragonlet,项目名称:clearhealth,代码行数:22,代码来源:TeamMember.php

示例15: createDefaultConfigIfNotExists

 /**
  * Create ConfigItem for default formulary table
  *
  * @return void
  */
 public static function createDefaultConfigIfNotExists()
 {
     $defaultTable = self::getDefaultFormularyTable();
     if ($defaultTable !== false) {
         $formulary = new self($defaultTable);
         if (!$formulary->populate(false)) {
             $formulary->activate();
             $formulary->setDefault();
             $formulary->persist(false);
         }
     }
 }
开发者ID:jakedorst,项目名称:ch3-dev-preview,代码行数:17,代码来源:FormularyItem.php


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