コード例 #1
0
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(AutodiscoveryDeviceServicePeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(AutodiscoveryDeviceServicePeer::DATABASE_NAME);
         $criteria->add(AutodiscoveryDeviceServicePeer::ID, $pks, Criteria::IN);
         $objs = AutodiscoveryDeviceServicePeer::doSelect($criteria, $con);
     }
     return $objs;
 }
コード例 #2
0
ファイル: autodiscovery.php プロジェクト: Evolix/lilac
            print_select("template", $options, "value", "option", $device->getHostTemplate());
            ?>
 <input type="submit" value="Assign Template" /> [ <a href="autodiscovery.php?id=<?php 
            echo $_GET['id'];
            ?>
&review=1&deviceId=<?php 
            echo $device->getId();
            ?>
&request=recalc">Recalculate Template Matches</a> ]
	</form>
	<br />
	<br />
	<?php 
            $c = new Criteria();
            $c->add(AutodiscoveryDeviceServicePeer::DEVICE_ID, $device->getId());
            $services = AutodiscoveryDeviceServicePeer::doSelect($c);
            if (empty($services)) {
                ?>
		<p>
		<h3>No Services Were Found On This Device</h3>
		</p>
		<?php 
            } else {
                ?>
		<h3>Found <?php 
                echo count($services);
                ?>
 Service(s)</h3>
		<table class="tablelist">
		<?php 
                $tmp = 0;
コード例 #3
0
 /**
  * Gets an array of AutodiscoveryDeviceService objects which contain a foreign key that references this object.
  *
  * If this collection has already been initialized with an identical Criteria, it returns the collection.
  * Otherwise if this AutodiscoveryDevice has previously been saved, it will retrieve
  * related AutodiscoveryDeviceServices from storage. If this AutodiscoveryDevice is new, it will return
  * an empty collection or the current collection, the criteria is ignored on a new object.
  *
  * @param      PropelPDO $con
  * @param      Criteria $criteria
  * @return     array AutodiscoveryDeviceService[]
  * @throws     PropelException
  */
 public function getAutodiscoveryDeviceServices($criteria = null, PropelPDO $con = null)
 {
     if ($criteria === null) {
         $criteria = new Criteria(AutodiscoveryDevicePeer::DATABASE_NAME);
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collAutodiscoveryDeviceServices === null) {
         if ($this->isNew()) {
             $this->collAutodiscoveryDeviceServices = array();
         } else {
             $criteria->add(AutodiscoveryDeviceServicePeer::DEVICE_ID, $this->id);
             AutodiscoveryDeviceServicePeer::addSelectColumns($criteria);
             $this->collAutodiscoveryDeviceServices = AutodiscoveryDeviceServicePeer::doSelect($criteria, $con);
         }
     } else {
         // criteria has no effect for a new object
         if (!$this->isNew()) {
             // the following code is to determine if a new query is
             // called for.  If the criteria is the same as the last
             // one, just return the collection.
             $criteria->add(AutodiscoveryDeviceServicePeer::DEVICE_ID, $this->id);
             AutodiscoveryDeviceServicePeer::addSelectColumns($criteria);
             if (!isset($this->lastAutodiscoveryDeviceServiceCriteria) || !$this->lastAutodiscoveryDeviceServiceCriteria->equals($criteria)) {
                 $this->collAutodiscoveryDeviceServices = AutodiscoveryDeviceServicePeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastAutodiscoveryDeviceServiceCriteria = $criteria;
     return $this->collAutodiscoveryDeviceServices;
 }