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


PHP Agent::parseLeadingNameInList方法代码示例

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


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

示例1: getDuplicateCollectorNumber

 public function getDuplicateCollectorNumber($start)
 {
     $retArr = array();
     $sql = '';
     if ($this->obsUid) {
         $sql = 'SELECT o.occid, o.eventdate, recordedby, o.recordnumber ' . 'FROM omoccurrences o INNER JOIN ' . '(SELECT eventdate, recordnumber FROM omoccurrences GROUP BY eventdate, recordnumber, collid, observeruid ' . 'HAVING Count(*)>1 AND collid = ' . $this->collid . ' AND observeruid = ' . $this->obsUid . ' AND eventdate IS NOT NULL AND recordnumber IS NOT NULL ' . 'AND recordnumber NOT IN("sn","s.n.","Not Provided","unknown")) intab ' . 'ON o.eventdate = intab.eventdate AND o.recordnumber = intab.recordnumber ' . 'WHERE collid = ' . $this->collid . ' AND observeruid = ' . $this->obsUid . ' ';
     } else {
         $sql = 'SELECT o.occid, o.eventdate, recordedby, o.recordnumber ' . 'FROM omoccurrences o INNER JOIN ' . '(SELECT eventdate, recordnumber FROM omoccurrences GROUP BY eventdate, recordnumber, collid ' . 'HAVING Count(*)>1 AND collid = ' . $this->collid . ' AND eventdate IS NOT NULL AND recordnumber IS NOT NULL ' . 'AND recordnumber NOT IN("sn","s.n.","Not Provided","unknown")) intab ' . 'ON o.eventdate = intab.eventdate AND o.recordnumber = intab.recordnumber ' . 'WHERE collid = ' . $this->collid . ' ';
     }
     //echo $sql;
     $rs = $this->conn->query($sql);
     $collArr = array();
     while ($r = $rs->fetch_object()) {
         $nameArr = Agent::parseLeadingNameInList($r->recordedby);
         if (isset($nameArr['last']) && $nameArr['last'] && strlen($nameArr['last']) > 2) {
             $lastName = $nameArr['last'];
             $collArr[$r->eventdate][$r->recordnumber][$lastName][] = $r->occid;
         }
     }
     $rs->free();
     //Collection duplicate clusters
     $occidArr = array();
     $cnt = 0;
     foreach ($collArr as $ed => $arr1) {
         foreach ($arr1 as $rn => $arr2) {
             foreach ($arr2 as $ln => $dupArr) {
                 if (count($dupArr) > 1) {
                     //Skip records until start is reached
                     if ($cnt >= $start) {
                         $sql = 'SELECT ' . $cnt . ' AS dupid, o.occid, o.catalognumber, o.othercatalognumbers, o.othercatalognumbers, o.family, o.sciname, o.recordedby, o.recordnumber, ' . 'o.associatedcollectors, o.eventdate, o.verbatimeventdate, o.country, o.stateprovince, o.county, o.municipality, o.locality, datelastmodified ' . 'FROM omoccurrences o ' . 'WHERE occid IN(' . implode(',', $dupArr) . ') ';
                         //echo $sql;
                         $retArr = array_merge($retArr, $this->getDuplicates($sql));
                     }
                     if ($cnt > $start + 200) {
                         break 3;
                     }
                     $cnt++;
                 }
             }
         }
     }
     return $retArr;
 }
开发者ID:Symbiota,项目名称:Symbiota,代码行数:43,代码来源:OccurrenceCleaner.php

示例2: constructAgentDetType

 /** Given a name, construct an agent object of the appropriate type.
  * 
  * @param name the name of the agent to construct.
  * @return an agent object or null;
  */
 public function constructAgentDetType($name)
 {
     $result = null;
     if (preg_match("/([|;&]| and )/", $name)) {
         // agent is a composite of more than one agent
         $result = constructNewAgent('Team', '', '', '', $name);
     } else {
         if (preg_match("/([Ee]xpedition|Exped.|[Cc]onsortium|Bureau of|[Ss]ociety|[Cc]ommission)/", $name)) {
             $result = constructNewAgent('Organization', '', '', '', $name);
         } else {
             $namebits = Agent::parseLeadingNameInList($name);
             $result = constructNewAgent('Individual', $namebits['first'], $namebits['middle'], $namebits['last'], '');
             $result->setnotes($name);
         }
     }
     return $result;
 }
开发者ID:Symbiota,项目名称:Symbiota,代码行数:22,代码来源:AgentManager.php


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