當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Organization::setType方法代碼示例

本文整理匯總了PHP中Organization::setType方法的典型用法代碼示例。如果您正苦於以下問題:PHP Organization::setType方法的具體用法?PHP Organization::setType怎麽用?PHP Organization::setType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Organization的用法示例。


在下文中一共展示了Organization::setType方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: convertOrganization

 private function convertOrganization($row, $type)
 {
     $organization = new Organization();
     $organization->setDescription($row['description']);
     $organization->setEndDate($row['end_date']);
     $organization->setField($row['field']);
     $organization->setName($row['name']);
     $organization->setSalary($row['salary']);
     $organization->setStartDate($row['start_date']);
     $organization->setSubField($row['sub_field']);
     $organization->setTitle($row['title']);
     $organization->setType($type);
     $organization->setWebpage($row['webpage']);
     if ($row['address_id']) {
         $res3 = mysqli_query($this->db, "select * from addresses where id = " . $row['address_id']);
         if (mysqli_num_rows($res3)) {
             $row = mysqli_fetch_array($res3, MYSQLI_ASSOC);
             $address = $this->convertAddress($row);
             $organization->setLocation($address);
         }
     }
     return $organization;
 }
開發者ID:vuxuandung,項目名稱:Partuza-bundle,代碼行數:23,代碼來源:PartuzaDbFetcher.php

示例2: getPeople


//.........這裏部分代碼省略.........
                 $strings = explode(',', $row['interests']);
                 $person->setInterests($strings);
             }
             //TODO: Not in ATutor yet, skeleton field
             if (!empty($row['smoker'])) {
                 $person->setSmoker($row['smoker']);
             }
             /* the following fields require additional queries so are only executed if requested */
             if (isset($fields['activities']) || isset($fields['@all'])) {
                 $activities = array();
                 $sql = "select title from " . TABLE_PREFIX . "social_activities where member_id = " . $member_id;
                 $res2 = mysql_query($sql, $this->db);
                 while (list($activity) = mysql_fetch_row($res2)) {
                     $activities[] = $activity;
                 }
                 $person->setActivities($activities);
             }
             if (isset($fields['addresses']) || isset($fields['@all'])) {
                 $addresses = array();
                 $sql = "select address, postal, city, province, country from " . TABLE_PREFIX . "members m where m.member_id = " . $member_id;
                 $res2 = mysql_query($sql, $this->db);
                 while ($row = mysql_fetch_assoc($res2)) {
                     if (empty($row['unstructured_address'])) {
                         $row['unstructured_address'] = trim($row['street_address'] . " " . $row['province'] . " " . $row['country']);
                     }
                     $addres = new Address($row['unstructured_address']);
                     $addres->setCountry($row['country']);
                     $addres->setLatitude($row['latitude']);
                     $addres->setLongitude($row['longitude']);
                     $addres->setLocality($row['locality']);
                     $addres->setPostalCode($row['postal_code']);
                     $addres->setRegion($row['province']);
                     $addres->setStreetAddress($row['street_address']);
                     $addres->setType($row['address_type']);
                     //FIXME quick and dirty hack to demo PC
                     $addres->setPrimary(true);
                     $addresses[] = $addres;
                 }
                 $person->setAddresses($addresses);
             }
             //TODO: Not in ATutor yet, skeleton field
             /*
                     if (isset($fields['bodyType']) || isset($fields['@all'])) {
                       $res2 = mysql_query($db, "select * from ".TABLE_PREFIX."person_body_type where person_id = " . $person_id);
                       if (@mysql_num_rows($res2)) {
                         $row = @mysql_fetch_assic($res2);
                         $bodyType = new BodyType();
                         $bodyType->setBuild($row['build']);
                         $bodyType->setEyeColor($row['eye_color']);
                         $bodyType->setHairColor($row['hair_color']);
                         $bodyType->setHeight($row['height']);
                         $bodyType->setWeight($row['weight']);
                         $person->setBodyType($bodyType);
                       }
                     }
             */
             //TODO: Not in ATutor yet, skeleton field
             /*
                     if (isset($fields['books']) || isset($fields['@all'])) {
                       $books = array();
                       $res2 = mysqli_query($db, "select book from ".TABLE_PREFIX."person_books where person_id = " . $person_id);
                       while (list($book) = @mysqli_fetch_row($res2)) {
                         $books[] = $book;
                       }
                       $person->setBooks($books);
                     }
開發者ID:vicentborja,項目名稱:ATutor,代碼行數:67,代碼來源:ATutorDbFetcher.php


注:本文中的Organization::setType方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。