本文整理汇总了PHP中Monitor::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Monitor::setId方法的具体用法?PHP Monitor::setId怎么用?PHP Monitor::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Monitor
的用法示例。
在下文中一共展示了Monitor::setId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeMonitor
/**
* Eliminar un Monitor Dado el $monitorId
*
* @param $monitorId
*/
public function removeMonitor($monitorId)
{
$tareaBean = new TareaBean($this->persistenceManager);
$monitorSalonBean = new MonitorSalonBean($this->persistenceManager);
$monitor = new Monitor();
$monitor->setId($monitorId);
# Validamos los campos
if (!EntityValidator::validateId($monitorId)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 104);
}
# Verificamos que la entidad exista.
if (!$this->monitorBean->getMonitor($monitor)) {
throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 105);
}
# Verificamos que la entidad no esté siendo utilziada en alguna otra.
# Verificamos que la entidad no esté siendo utilziada en Tarea->tareaMonitor
$tareas = $tareaBean->getTareasByTareaMonitor($monitor);
if (count($tareas) > 0) {
throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 102);
}
# Verificamos que la entidad no esté siendo utilziada en MonitorSalon->monitor
$monitorSalons = $monitorSalonBean->getMonitorSalonsByMonitor($monitor);
if (count($monitorSalons) > 0) {
throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_LINKED_FAIL, $this->ID + 103);
}
# Eliminamos la entidad
if (!$this->monitorBean->removeMonitor($monitor)) {
throw new Exception(SALAS_COMP_ALERT_E_PERSISTENCE_REMOVE_FAIL, $this->ID + 106);
}
}
示例2: listTareasByTareaMonitorId
/**
* Listar algunos Tarea dado el $tareaMonitorId
*
* @param $tareaMonitorId
* @param $performSize
* @param $firstResultNumber
* @param $numResults
*/
public function listTareasByTareaMonitorId($tareaMonitorId, $performSize = false, $firstResultNumber = null, $numResults = null, $orderBy = null, $orderPriority = SQL_ASCENDING_ORDER)
{
$objBean = new MonitorBean($this->persistenceManager);
$obj = new Monitor();
$obj->setId($tareaMonitorId);
# Validamos los campos
if ($firstResultNumber !== null && !EntityValidator::validatePositiveNumber($firstResultNumber)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 143);
}
if (!EntityValidator::validateGlobalOrderPriority($orderPriority)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 145);
}
if (!EntityValidator::validateId($tareaMonitorId)) {
throw new Exception(SALAS_COMP_ALERT_E_VALIDATION_FAIL, $this->ID + 147);
}
# Verificamos que la entidad exista
if (!$objBean->getMonitor($obj)) {
throw new Exception(SALAS_COMP_ALERT_E_ENTITY_NOT_FOUND_FAIL, $this->ID + 149);
}
# Listamos las entidades
if ($performSize) {
$this->lastRequestSize = $this->tareaBean->countGetTareasByTareaMonitor($obj);
}
return TareaDTO::loadFromEntities($this->tareaBean->listTareasByTareaMonitor($obj, $firstResultNumber, $numResults, $orderBy, $orderPriority));
}
示例3: toEntity
public static function toEntity(MonitorDTO $monitorDTO)
{
$monitor = new Monitor();
$monitor->setId($monitorDTO->getId());
$monitor->setMonitorTipo($monitorDTO->getMonitorTipo());
$monitor->setMonitorHorario($monitorDTO->getMonitorHorario());
$monitor->setMonitorEstudiante($monitorDTO->getMonitorEstudiante());
return $monitor;
}