@@ 435-452 (lines=18) @@ | ||
432 | $expressionResult = false; |
|
433 | ||
434 | switch ($field) { |
|
435 | case FieldExpression::ACTION: |
|
436 | if (!is_numeric($value)) { |
|
437 | $errMsg = 'unknown field'; |
|
438 | throw new InvalidArgumentException($errMsg); |
|
439 | } |
|
440 | ||
441 | $actionId = (integer)$value; |
|
442 | ||
443 | foreach ($steps as $step) { |
|
444 | if ($this->compareLong($step->getActionId(), $actionId, $operator)) { |
|
445 | $expressionResult = true; |
|
446 | ||
447 | break; |
|
448 | } |
|
449 | } |
|
450 | ||
451 | ||
452 | break; |
|
453 | ||
454 | case FieldExpression::CALLER: |
|
455 | $caller = $value; |
|
@@ 454-469 (lines=16) @@ | ||
451 | ||
452 | break; |
|
453 | ||
454 | case FieldExpression::CALLER: |
|
455 | $caller = $value; |
|
456 | if ('string' !== gettype($caller)) { |
|
457 | $errMsg = 'unknown field'; |
|
458 | throw new InvalidArgumentException($errMsg); |
|
459 | } |
|
460 | ||
461 | foreach ($steps as $step) { |
|
462 | if ($this->compareText($step->getCaller(), $caller, $operator)) { |
|
463 | $expressionResult = true; |
|
464 | ||
465 | break; |
|
466 | } |
|
467 | } |
|
468 | ||
469 | break; |
|
470 | ||
471 | case FieldExpression::FINISH_DATE: |
|
472 | if ($value instanceof DateTime) { |
|
@@ 471-486 (lines=16) @@ | ||
468 | ||
469 | break; |
|
470 | ||
471 | case FieldExpression::FINISH_DATE: |
|
472 | if ($value instanceof DateTime) { |
|
473 | $finishDate = $value; |
|
474 | foreach ($steps as $step) { |
|
475 | if ($this->compareDate($step->getFinishDate(), $finishDate, $operator)) { |
|
476 | $expressionResult = true; |
|
477 | ||
478 | break; |
|
479 | } |
|
480 | } |
|
481 | } else { |
|
482 | $errMsg = 'unknown field'; |
|
483 | throw new InvalidArgumentException($errMsg); |
|
484 | } |
|
485 | ||
486 | break; |
|
487 | ||
488 | case FieldExpression::OWNER: |
|
489 | $owner = $value; |
|
@@ 488-504 (lines=17) @@ | ||
485 | ||
486 | break; |
|
487 | ||
488 | case FieldExpression::OWNER: |
|
489 | $owner = $value; |
|
490 | if ('string' !== gettype($owner)) { |
|
491 | $errMsg = 'unknown field'; |
|
492 | throw new InvalidArgumentException($errMsg); |
|
493 | } |
|
494 | ||
495 | foreach ($steps as $step) { |
|
496 | if ($this->compareText($step->getOwner(), $owner, $operator)) { |
|
497 | $expressionResult = true; |
|
498 | ||
499 | break; |
|
500 | } |
|
501 | } |
|
502 | ||
503 | ||
504 | break; |
|
505 | ||
506 | case FieldExpression::START_DATE: |
|
507 | if ($value instanceof DateTime) { |
|
@@ 506-521 (lines=16) @@ | ||
503 | ||
504 | break; |
|
505 | ||
506 | case FieldExpression::START_DATE: |
|
507 | if ($value instanceof DateTime) { |
|
508 | $startDate = $value; |
|
509 | foreach ($steps as $step) { |
|
510 | if ($this->compareDate($step->getStartDate(), $startDate, $operator)) { |
|
511 | $expressionResult = true; |
|
512 | ||
513 | break; |
|
514 | } |
|
515 | } |
|
516 | } else { |
|
517 | $errMsg = 'unknown field'; |
|
518 | throw new InvalidArgumentException($errMsg); |
|
519 | } |
|
520 | ||
521 | break; |
|
522 | ||
523 | case FieldExpression::STEP: |
|
524 | if (!is_numeric($value)) { |
|
@@ 523-538 (lines=16) @@ | ||
520 | ||
521 | break; |
|
522 | ||
523 | case FieldExpression::STEP: |
|
524 | if (!is_numeric($value)) { |
|
525 | $errMsg = 'unknown field'; |
|
526 | throw new InvalidArgumentException($errMsg); |
|
527 | } |
|
528 | $stepId = (integer)$value; |
|
529 | ||
530 | foreach ($steps as $step) { |
|
531 | if ($this->compareLong($step->getStepId(), $stepId, $operator)) { |
|
532 | $expressionResult = true; |
|
533 | ||
534 | break; |
|
535 | } |
|
536 | } |
|
537 | ||
538 | break; |
|
539 | ||
540 | case FieldExpression::STATUS: |
|
541 | $status = $value; |
|
@@ 540-555 (lines=16) @@ | ||
537 | ||
538 | break; |
|
539 | ||
540 | case FieldExpression::STATUS: |
|
541 | $status = $value; |
|
542 | if ('string' !== gettype($status)) { |
|
543 | $errMsg = 'unknown field'; |
|
544 | throw new InvalidArgumentException($errMsg); |
|
545 | } |
|
546 | ||
547 | foreach ($steps as $step) { |
|
548 | if ($this->compareText($step->getStatus(), $status, $operator)) { |
|
549 | $expressionResult = true; |
|
550 | ||
551 | break; |
|
552 | } |
|
553 | } |
|
554 | ||
555 | break; |
|
556 | ||
557 | case FieldExpression::DUE_DATE: |
|
558 | if ($value instanceof DateTime) { |
|
@@ 557-573 (lines=17) @@ | ||
554 | ||
555 | break; |
|
556 | ||
557 | case FieldExpression::DUE_DATE: |
|
558 | if ($value instanceof DateTime) { |
|
559 | $dueDate = $value; |
|
560 | foreach ($steps as $step) { |
|
561 | if ($this->compareDate($step->getDueDate(), $dueDate, $operator)) { |
|
562 | $expressionResult = true; |
|
563 | ||
564 | break; |
|
565 | } |
|
566 | } |
|
567 | } else { |
|
568 | $errMsg = 'unknown field'; |
|
569 | throw new InvalidArgumentException($errMsg); |
|
570 | } |
|
571 | ||
572 | ||
573 | break; |
|
574 | } |
|
575 | ||
576 | if ($expression->isNegate()) { |