echo $locate->getCapacity() ? $locate->getCapacity() : '-'; ?> </td> <td><?php echo $locate->getLocationCategoryId() ? $locate->getLocationCategory()->toString() : '-'; ?> </td> <td><?php echo $locate->getLocationConditionId() ? $locate->getLocationCondition()->toString() : '-'; ?> </td> <td style="text-align: center;"> <?php $c = new Criteria(); $c->add(FacilityLocationPeer::LOCATION_ID, $locate->getId()); $count = FacilityLocationPeer::doCount($c); ?> <?php echo link_to_remote($count, array('url' => 'locate/listFacility?id=' . $locate->getId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')); ?> </td> </tr> <?php } ?> <?php } ?> </tbody> </table>
protected static function doOnDeleteCascade(Criteria $criteria, Connection $con) { $affectedRows = 0; $objects = LocationPeer::doSelect($criteria, $con); foreach ($objects as $obj) { include_once 'lib/model/FacilityLocation.php'; $c = new Criteria(); $c->add(FacilityLocationPeer::LOCATION_ID, $obj->getId()); $affectedRows += FacilityLocationPeer::doDelete($c, $con); } return $affectedRows; }
public function executeDeleteFacility() { $locate = LocationPeer::retrieveByPk($this->getRequestParameter('location_id')); $this->forward404Unless($locate); $c = new Criteria(); $c->add(FacilityLocationPeer::ID, $this->getRequestParameter('id')); $facility = FacilityLocationPeer::doSelectOne($c); $facility->delete(); return $this->forward('locate', 'listFacility?id=' . $locate->getId()); }
public function getFacilityLocationsJoinLocation($criteria = null, $con = null) { include_once 'lib/model/om/BaseFacilityLocationPeer.php'; if ($criteria === null) { $criteria = new Criteria(); } elseif ($criteria instanceof Criteria) { $criteria = clone $criteria; } if ($this->collFacilityLocations === null) { if ($this->isNew()) { $this->collFacilityLocations = array(); } else { $criteria->add(FacilityLocationPeer::FACILITY_ID, $this->getId()); $this->collFacilityLocations = FacilityLocationPeer::doSelectJoinLocation($criteria, $con); } } else { $criteria->add(FacilityLocationPeer::FACILITY_ID, $this->getId()); if (!isset($this->lastFacilityLocationCriteria) || !$this->lastFacilityLocationCriteria->equals($criteria)) { $this->collFacilityLocations = FacilityLocationPeer::doSelectJoinLocation($criteria, $con); } } $this->lastFacilityLocationCriteria = $criteria; return $this->collFacilityLocations; }
public static function retrieveByPK($id, $facility_id, $location_id, $con = null) { if ($con === null) { $con = Propel::getConnection(self::DATABASE_NAME); } $criteria = new Criteria(); $criteria->add(FacilityLocationPeer::ID, $id); $criteria->add(FacilityLocationPeer::FACILITY_ID, $facility_id); $criteria->add(FacilityLocationPeer::LOCATION_ID, $location_id); $v = FacilityLocationPeer::doSelect($criteria, $con); return !empty($v) ? $v[0] : null; }
public function executeDeleteFacilityEdit() { $c = new Criteria(); $c->add(FacilityLocationPeer::ID, $this->getRequestParameter('facility_id')); $facility_location = FacilityLocationPeer::doSelectOne($c); $ref_error = 0; foreach ($facility_location->getRefCountMethods() as $ref) { $method = "count" . $ref['affix']; $count = $facility_location->{$method}(); if ($count > 0) { ++$ref_error; $this->getRequest()->setError('location/deleteFacilityEdit/' . sfInflector::camelize($ref['table']), $count); } } if ($ref_error > 0) { $this->getRequest()->setError('location/deleteFacilityEdit', '_ERR_DELETE_ (' . $facility_location->getFacility()->getName() . ' - id:' . $facility_location->getId() . ')'); } else { $facility_location->delete(); } #return $this->forward('location', 'list'); return $this->redirect('location/edit?id=' . $this->getRequestParameter('id')); }
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = FacilityLocationPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setFacilityId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setLocationId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setStatus($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setTotal($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setAcademicCalendarId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setDetail($arr[$keys[6]]); } }