Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like Job often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Job, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 40 | class Job extends BaseEntity implements JobInterface, |
||
|
|
|||
| 41 | DraftableEntityInterface, |
||
| 42 | SnapshotGeneratorProviderInterface |
||
| 43 | |||
| 44 | { |
||
| 45 | use AttachableEntityTrait, MetaDataProviderTrait, ClonePropertiesTrait; |
||
| 46 | |||
| 47 | |||
| 48 | private $cloneProperties = [ |
||
| 49 | 'classifications', 'atsMode', |
||
| 50 | ]; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * unique ID of a job posting used by applications to reference |
||
| 54 | * a job |
||
| 55 | * |
||
| 56 | * @var String |
||
| 57 | * @ODM\Field(type="string") @ODM\Index |
||
| 58 | **/ |
||
| 59 | protected $applyId; |
||
| 60 | |||
| 61 | /** |
||
| 62 | * title of a job posting |
||
| 63 | * |
||
| 64 | * @var String |
||
| 65 | * @ODM\Field(type="string") |
||
| 66 | */ |
||
| 67 | protected $title; |
||
| 68 | |||
| 69 | |||
| 70 | /** |
||
| 71 | * name of the publishing company |
||
| 72 | * |
||
| 73 | * @var String |
||
| 74 | * @ODM\Field(type="string") |
||
| 75 | */ |
||
| 76 | protected $company; |
||
| 77 | |||
| 78 | /** |
||
| 79 | * publishing company |
||
| 80 | * |
||
| 81 | * @var OrganizationInterface |
||
| 82 | * @ODM\ReferenceOne (targetDocument="\Organizations\Entity\Organization", simple=true, inversedBy="jobs") |
||
| 83 | * @ODM\Index |
||
| 84 | */ |
||
| 85 | protected $organization; |
||
| 86 | |||
| 87 | |||
| 88 | /** |
||
| 89 | * Email Address, which is used to send notifications about e.g. new applications. |
||
| 90 | * |
||
| 91 | * @var String |
||
| 92 | * @ODM\Field(type="string") |
||
| 93 | **/ |
||
| 94 | protected $contactEmail; |
||
| 95 | |||
| 96 | /** |
||
| 97 | * the owner of a Job Posting |
||
| 98 | * |
||
| 99 | * @var UserInterface $user |
||
| 100 | * @ODM\ReferenceOne(targetDocument="\Auth\Entity\User", simple=true) |
||
| 101 | * @ODM\Index |
||
| 102 | */ |
||
| 103 | protected $user; |
||
| 104 | |||
| 105 | /** |
||
| 106 | * all applications of a certain jobad |
||
| 107 | * |
||
| 108 | * @var Collection |
||
| 109 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", simple=true, mappedBy="job", |
||
| 110 | * repositoryMethod="loadApplicationsForJob") |
||
| 111 | */ |
||
| 112 | protected $applications; |
||
| 113 | |||
| 114 | /** |
||
| 115 | * new applications |
||
| 116 | * |
||
| 117 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", |
||
| 118 | * repositoryMethod="loadUnreadApplicationsForJob", mappedBy="job") |
||
| 119 | * @var Int |
||
| 120 | */ |
||
| 121 | protected $unreadApplications; |
||
| 122 | |||
| 123 | /** |
||
| 124 | * language of the job posting. Languages are ISO 639-1 coded |
||
| 125 | * |
||
| 126 | * @var String |
||
| 127 | * @ODM\Field(type="string") |
||
| 128 | */ |
||
| 129 | protected $language; |
||
| 130 | |||
| 131 | /** |
||
| 132 | * location of the job posting. This is a plain text, which describes the location in |
||
| 133 | * search e.g. results. |
||
| 134 | * |
||
| 135 | * @var String |
||
| 136 | * @ODM\Field(type="string") |
||
| 137 | */ |
||
| 138 | protected $location; |
||
| 139 | |||
| 140 | /** |
||
| 141 | * locations of the job posting. This collection contains structured coordinates, |
||
| 142 | * postal codes, city, region, and country names |
||
| 143 | * |
||
| 144 | * @var Collection |
||
| 145 | * @ODM\EmbedMany(targetDocument="Location") |
||
| 146 | */ |
||
| 147 | protected $locations; |
||
| 148 | |||
| 149 | /** |
||
| 150 | * Link which points to the job posting |
||
| 151 | * |
||
| 152 | * @var String |
||
| 153 | * @ODM\Field(type="string") |
||
| 154 | **/ |
||
| 155 | protected $link; |
||
| 156 | |||
| 157 | /** |
||
| 158 | * publishing date of a job posting |
||
| 159 | * |
||
| 160 | * @var String |
||
| 161 | * @ODM\Field(type="tz_date") |
||
| 162 | */ |
||
| 163 | protected $datePublishStart; |
||
| 164 | |||
| 165 | /** |
||
| 166 | * end date of a job posting |
||
| 167 | * |
||
| 168 | * @var String |
||
| 169 | * @ODM\Field(type="tz_date") |
||
| 170 | */ |
||
| 171 | protected $datePublishEnd; |
||
| 172 | |||
| 173 | /** |
||
| 174 | * Status of the job posting |
||
| 175 | * |
||
| 176 | * @var Status |
||
| 177 | * @ODM\EmbedOne(targetDocument="Status") |
||
| 178 | * @ODM\Index |
||
| 179 | */ |
||
| 180 | protected $status; |
||
| 181 | |||
| 182 | /** |
||
| 183 | * History on an job posting |
||
| 184 | * |
||
| 185 | * @var Collection |
||
| 186 | * @ODM\EmbedMany(targetDocument="History") |
||
| 187 | */ |
||
| 188 | protected $history; |
||
| 189 | |||
| 190 | /** |
||
| 191 | * Flag, privacy policy is accepted or not. |
||
| 192 | * |
||
| 193 | * @var bool |
||
| 194 | * @ODM\Boolean |
||
| 195 | */ |
||
| 196 | protected $termsAccepted; |
||
| 197 | |||
| 198 | /** |
||
| 199 | * Reference of a job opening, on which an applicant can refer to. |
||
| 200 | * |
||
| 201 | * @var String |
||
| 202 | * @ODM\Field(type="string") |
||
| 203 | */ |
||
| 204 | protected $reference; |
||
| 205 | |||
| 206 | /** |
||
| 207 | * Unified Resource Locator to the company-Logo |
||
| 208 | * |
||
| 209 | * @var String |
||
| 210 | * @ODM\Field(type="string") |
||
| 211 | */ |
||
| 212 | protected $logoRef; |
||
| 213 | |||
| 214 | /** |
||
| 215 | * Template-Name |
||
| 216 | * |
||
| 217 | * @var String |
||
| 218 | * @ODM\Field(type="string") |
||
| 219 | */ |
||
| 220 | protected $template; |
||
| 221 | |||
| 222 | /** |
||
| 223 | * Application link. |
||
| 224 | * |
||
| 225 | * @var String |
||
| 226 | * @ODM\Field(type="string") |
||
| 227 | */ |
||
| 228 | protected $uriApply; |
||
| 229 | |||
| 230 | /** |
||
| 231 | * Unified Resource Locator the Yawik, which handled this job first - so |
||
| 232 | * does know who is the one who has commited this job. |
||
| 233 | * |
||
| 234 | * @var String |
||
| 235 | * @ODM\Field(type="string") |
||
| 236 | */ |
||
| 237 | protected $uriPublisher; |
||
| 238 | |||
| 239 | /** |
||
| 240 | * @var |
||
| 241 | * @ODM\EmbedMany(targetDocument="Publisher") |
||
| 242 | */ |
||
| 243 | protected $publisher; |
||
| 244 | |||
| 245 | /** |
||
| 246 | * The ATS mode entity. |
||
| 247 | * |
||
| 248 | * @var AtsMode |
||
| 249 | * @ODM\EmbedOne(targetDocument="AtsMode") |
||
| 250 | */ |
||
| 251 | protected $atsMode; |
||
| 252 | |||
| 253 | /** |
||
| 254 | * this must be enabled to use applications forms etc. for this job or |
||
| 255 | * to see number of applications in the list of applications |
||
| 256 | * |
||
| 257 | * @var Boolean |
||
| 258 | * |
||
| 259 | * @ODM\Boolean |
||
| 260 | */ |
||
| 261 | protected $atsEnabled; |
||
| 262 | |||
| 263 | /** |
||
| 264 | * Permissions |
||
| 265 | * |
||
| 266 | * @var PermissionsInterface |
||
| 267 | * @ODM\EmbedOne(targetDocument="\Core\Entity\Permissions") |
||
| 268 | */ |
||
| 269 | protected $permissions; |
||
| 270 | |||
| 271 | /** |
||
| 272 | * The actual name of the organization. |
||
| 273 | * |
||
| 274 | * @var TemplateValues |
||
| 275 | * @ODM\EmbedOne(targetDocument="\Jobs\Entity\TemplateValues") |
||
| 276 | */ |
||
| 277 | protected $templateValues; |
||
| 278 | |||
| 279 | |||
| 280 | /** |
||
| 281 | * Can contain various Portals |
||
| 282 | * |
||
| 283 | * @var array |
||
| 284 | * @ODM\Collection*/ |
||
| 285 | protected $portals = array(); |
||
| 286 | |||
| 287 | /** |
||
| 288 | * Flag indicating draft state of this job. |
||
| 289 | * |
||
| 290 | * @var bool |
||
| 291 | * @ODM\Boolean |
||
| 292 | */ |
||
| 293 | protected $isDraft = false; |
||
| 294 | |||
| 295 | /** |
||
| 296 | * Classifications |
||
| 297 | * |
||
| 298 | * @ODM\EmbedOne(targetDocument="\Jobs\Entity\Classifications") |
||
| 299 | * @var Classifications |
||
| 300 | * @since 0.29 |
||
| 301 | */ |
||
| 302 | protected $classifications; |
||
| 303 | |||
| 304 | /** |
||
| 305 | * Delete flag. |
||
| 306 | * |
||
| 307 | * @internal |
||
| 308 | * This is meant as a temporary flag, until |
||
| 309 | * SoftDelete is implemented. |
||
| 310 | * |
||
| 311 | * @ODM\Field(type="boolean") |
||
| 312 | * @var bool |
||
| 313 | * @since 0.29 |
||
| 314 | */ |
||
| 315 | protected $isDeleted = false; |
||
| 316 | |||
| 317 | /** |
||
| 318 | * |
||
| 319 | * @ODM\ReferenceMany(targetDocument="\Jobs\Entity\JobSnapshot", mappedBy="snapshotEntity", sort={"snapshotMeta.dateCreated"="desc"}) |
||
| 320 | * @var JobSnapshot |
||
| 321 | */ |
||
| 322 | protected $snapshots; |
||
| 323 | |||
| 324 | /** |
||
| 325 | * @ODM\ReferenceOne(targetDocument="\Jobs\Entity\JobSnapshot", mappedBy="snapshotEntity", sort={"snapshotMeta.dateCreated"="desc"}) |
||
| 326 | * |
||
| 327 | * @var JobSnapshot |
||
| 328 | */ |
||
| 329 | protected $latestSnapshot; |
||
| 330 | |||
| 331 | |||
| 332 | public function getSnapshots() |
||
| 336 | |||
| 337 | public function getLatestSnapshot() |
||
| 341 | |||
| 342 | public function hasSnapshotDraft() |
||
| 347 | |||
| 348 | /** |
||
| 349 | * @return string |
||
| 350 | */ |
||
| 351 | public function getResourceId() |
||
| 355 | |||
| 356 | /** |
||
| 357 | * @see \Jobs\Entity\JobInterface::setApplyId() |
||
| 358 | * @param String $applyId |
||
| 359 | * @return \Jobs\Entity\JobInterface |
||
| 360 | */ |
||
| 361 | public function setApplyId($applyId) |
||
| 366 | /** |
||
| 367 | * @see \Jobs\Entity\JobInterface::getApplyId() |
||
| 368 | * @return String |
||
| 369 | */ |
||
| 370 | public function getApplyId() |
||
| 378 | |||
| 379 | /** |
||
| 380 | * Gets the title of a job posting |
||
| 381 | * |
||
| 382 | * @return string |
||
| 383 | */ |
||
| 384 | public function getTitle() |
||
| 388 | |||
| 389 | /** |
||
| 390 | * Sets the title of a job posting |
||
| 391 | * |
||
| 392 | * @see \Jobs\Entity\JobInterface::setTitle() |
||
| 393 | * @param String $title |
||
| 394 | * @return \Jobs\Entity\JobInterface |
||
| 395 | */ |
||
| 396 | public function setTitle($title) |
||
| 401 | |||
| 402 | /** |
||
| 403 | * Gets the name oof the company. If there is an organization assigned to the |
||
| 404 | * job posting. Take the name of the organization. |
||
| 405 | * |
||
| 406 | * @param bool $useOrganizationEntity Get the name from the organization entity, if it is available. |
||
| 407 | * @see \Jobs\Entity\JobInterface::getCompany() |
||
| 408 | * @return string |
||
| 409 | */ |
||
| 410 | public function getCompany($useOrganizationEntity = true) |
||
| 418 | |||
| 419 | /** |
||
| 420 | * (non-PHPdoc) |
||
| 421 | * @see \Jobs\Entity\JobInterface::setCompany() |
||
| 422 | */ |
||
| 423 | public function setCompany($company) |
||
| 428 | |||
| 429 | /** |
||
| 430 | * (non-PHPdoc) |
||
| 431 | * @see \Jobs\Entity\JobInterface::getOrganization() |
||
| 432 | */ |
||
| 433 | public function getOrganization() |
||
| 437 | |||
| 438 | /** |
||
| 439 | * @inheritdoc |
||
| 440 | */ |
||
| 441 | public function setOrganization(OrganizationInterface $organization = null) |
||
| 453 | |||
| 454 | /** |
||
| 455 | * (non-PHPdoc) |
||
| 456 | * @see \Jobs\Entity\JobInterface::getContactEmail() |
||
| 457 | */ |
||
| 458 | public function getContactEmail() |
||
| 470 | |||
| 471 | /** |
||
| 472 | * (non-PHPdoc) |
||
| 473 | * @see \Jobs\Entity\JobInterface::setContactEmail() |
||
| 474 | */ |
||
| 475 | public function setContactEmail($email) |
||
| 480 | |||
| 481 | /** |
||
| 482 | * (non-PHPdoc) |
||
| 483 | * @see \Jobs\Entity\JobInterface::setLanguage() |
||
| 484 | */ |
||
| 485 | public function setLanguage($language) |
||
| 490 | /** |
||
| 491 | * (non-PHPdoc) |
||
| 492 | * @see \Jobs\Entity\JobInterface::getLanguage() |
||
| 493 | */ |
||
| 494 | public function getLanguage() |
||
| 498 | /** |
||
| 499 | * (non-PHPdoc) |
||
| 500 | * @see \Jobs\Entity\JobInterface::setLocation() |
||
| 501 | */ |
||
| 502 | public function setLocation($location) |
||
| 507 | /** |
||
| 508 | * (non-PHPdoc) |
||
| 509 | * @see \Jobs\Entity\JobInterface::getLocation() |
||
| 510 | */ |
||
| 511 | public function getLocation() |
||
| 524 | /** |
||
| 525 | * (non-PHPdoc) |
||
| 526 | * @see \Jobs\Entity\JobInterface::setLocations() |
||
| 527 | */ |
||
| 528 | public function setLocations($locations) |
||
| 533 | /** |
||
| 534 | * (non-PHPdoc) |
||
| 535 | * @see \Jobs\Entity\JobInterface::getLocations() |
||
| 536 | */ |
||
| 537 | public function getLocations() |
||
| 544 | /** |
||
| 545 | * (non-PHPdoc) |
||
| 546 | * @see \Jobs\Entity\JobInterface::setUser() |
||
| 547 | */ |
||
| 548 | View Code Duplication | public function setUser(UserInterface $user) |
|
| 557 | /** |
||
| 558 | * (non-PHPdoc) |
||
| 559 | * @see \Jobs\Entity\JobInterface::getUser() |
||
| 560 | */ |
||
| 561 | public function getUser() |
||
| 565 | |||
| 566 | public function unsetUser($removePermissions = true) |
||
| 577 | |||
| 578 | /** |
||
| 579 | * (non-PHPdoc) |
||
| 580 | * @see \Jobs\Entity\JobInterface::setApplications() |
||
| 581 | */ |
||
| 582 | public function setApplications(Collection $applications) |
||
| 587 | |||
| 588 | /** |
||
| 589 | * (non-PHPdoc) |
||
| 590 | * @see \Jobs\Entity\JobInterface::getApplications() |
||
| 591 | */ |
||
| 592 | public function getApplications() |
||
| 596 | |||
| 597 | /** |
||
| 598 | * Gets the number of unread applications |
||
| 599 | * @return Collection |
||
| 600 | */ |
||
| 601 | public function getUnreadApplications() |
||
| 605 | /** |
||
| 606 | * (non-PHPdoc) |
||
| 607 | * @see \Jobs\Entity\JobInterface::getLink() |
||
| 608 | */ |
||
| 609 | public function getLink() |
||
| 613 | /** |
||
| 614 | * (non-PHPdoc) |
||
| 615 | * @see \Jobs\Entity\JobInterface::setLink() |
||
| 616 | */ |
||
| 617 | public function setLink($link) |
||
| 622 | /** |
||
| 623 | * (non-PHPdoc) |
||
| 624 | * @see \Jobs\Entity\JobInterface::getDatePublishStart() |
||
| 625 | */ |
||
| 626 | public function getDatePublishStart() |
||
| 630 | /** |
||
| 631 | * (non-PHPdoc) |
||
| 632 | * @param string $datePublishStart |
||
| 633 | * @see \Jobs\Entity\JobInterface::setDatePublishStart() |
||
| 634 | * @return $this |
||
| 635 | */ |
||
| 636 | View Code Duplication | public function setDatePublishStart($datePublishStart = null) |
|
| 647 | |||
| 648 | /** |
||
| 649 | * (non-PHPdoc) |
||
| 650 | * @see \Jobs\Entity\JobInterface::getDatePublishStart() |
||
| 651 | */ |
||
| 652 | public function getDatePublishEnd() |
||
| 656 | /** |
||
| 657 | * (non-PHPdoc) |
||
| 658 | * @param string $datePublishEnd |
||
| 659 | * @see \Jobs\Entity\JobInterface::setDatePublishEnd() |
||
| 660 | * @return $this |
||
| 661 | */ |
||
| 662 | View Code Duplication | public function setDatePublishEnd($datePublishEnd = null) |
|
| 673 | |||
| 674 | /** |
||
| 675 | * Modifies the state of an application. |
||
| 676 | * |
||
| 677 | * Creates a history entry. |
||
| 678 | * |
||
| 679 | * @param StatusInterface|string $status |
||
| 680 | * @param string $message |
||
| 681 | * @return Job |
||
| 682 | */ |
||
| 683 | View Code Duplication | public function changeStatus($status, $message = '[System]') |
|
| 693 | |||
| 694 | /** |
||
| 695 | * (non-PHPdoc) |
||
| 696 | * @see \Jobs\Entity\JobInterface::getStatus() |
||
| 697 | */ |
||
| 698 | public function getStatus() |
||
| 702 | /** |
||
| 703 | * (non-PHPdoc) |
||
| 704 | * @see \Jobs\Entity\JobInterface::setStatus() |
||
| 705 | */ |
||
| 706 | public function setStatus($status) |
||
| 713 | |||
| 714 | /** |
||
| 715 | * {@inheritDoc} |
||
| 716 | * @see JobInterface::setHistory() |
||
| 717 | * @return Job |
||
| 718 | */ |
||
| 719 | public function setHistory(Collection $history) |
||
| 724 | |||
| 725 | /** |
||
| 726 | * {@inheritDoc} |
||
| 727 | * @see JobInterface::getHistory() |
||
| 728 | */ |
||
| 729 | public function getHistory() |
||
| 736 | |||
| 737 | /** |
||
| 738 | * {@inheritDoc} |
||
| 739 | * @see JobInterface::setTermsAccepted() |
||
| 740 | * @return self |
||
| 741 | */ |
||
| 742 | public function setTermsAccepted($termsAccepted) |
||
| 747 | |||
| 748 | /** |
||
| 749 | * {qinheritDoc} |
||
| 750 | * @see JobInterface::getTermsAccepted() |
||
| 751 | */ |
||
| 752 | public function getTermsAccepted() |
||
| 756 | |||
| 757 | /** |
||
| 758 | * (non-PHPdoc) |
||
| 759 | * @see JobInterface::getReference() |
||
| 760 | */ |
||
| 761 | public function getReference() |
||
| 765 | /** |
||
| 766 | * (non-PHPdoc) |
||
| 767 | * @see JobInterface::setReference() |
||
| 768 | */ |
||
| 769 | public function setReference($reference) |
||
| 774 | |||
| 775 | public function setAtsMode(AtsMode $mode) |
||
| 781 | |||
| 782 | public function getAtsMode() |
||
| 790 | |||
| 791 | |||
| 792 | /** |
||
| 793 | * checks, weather a job is enabled for getting applications |
||
| 794 | * @return boolean |
||
| 795 | */ |
||
| 796 | public function getAtsEnabled() |
||
| 800 | /** |
||
| 801 | * enables a job add to receive applications |
||
| 802 | * |
||
| 803 | * @param boolean $atsEnabled |
||
| 804 | * @return \Jobs\Entity\Job |
||
| 805 | */ |
||
| 806 | public function setAtsEnabled($atsEnabled) |
||
| 811 | /** |
||
| 812 | * returns an uri to the organization logo. |
||
| 813 | * |
||
| 814 | * @return string |
||
| 815 | */ |
||
| 816 | public function getLogoRef() |
||
| 826 | /** |
||
| 827 | * Set the uri to the organisations logo |
||
| 828 | * |
||
| 829 | * @param string $logoRef |
||
| 830 | * @return \Jobs\Entity\Job |
||
| 831 | */ |
||
| 832 | public function setLogoRef($logoRef) |
||
| 837 | |||
| 838 | /** |
||
| 839 | * |
||
| 840 | * |
||
| 841 | * @return string |
||
| 842 | */ |
||
| 843 | public function getTemplate() |
||
| 851 | /** |
||
| 852 | * |
||
| 853 | * |
||
| 854 | * @param string $template name of the Template |
||
| 855 | * @return \Jobs\Entity\Job |
||
| 856 | */ |
||
| 857 | public function setTemplate($template) |
||
| 862 | |||
| 863 | |||
| 864 | |||
| 865 | /** |
||
| 866 | * Gets the uri of an application link |
||
| 867 | * |
||
| 868 | * @return String |
||
| 869 | */ |
||
| 870 | public function getUriApply() |
||
| 874 | |||
| 875 | /** |
||
| 876 | * Sets the uri of an application link |
||
| 877 | * |
||
| 878 | * @param String $uriApply |
||
| 879 | * @return \Jobs\Entity\Job |
||
| 880 | */ |
||
| 881 | public function setUriApply($uriApply) |
||
| 886 | |||
| 887 | /** |
||
| 888 | * Gets the uri of a publisher |
||
| 889 | * |
||
| 890 | * @return String |
||
| 891 | */ |
||
| 892 | public function getUriPublisher() |
||
| 896 | /** |
||
| 897 | * |
||
| 898 | * @param String $uriPublisher |
||
| 899 | * @return \Jobs\Entity\Job |
||
| 900 | */ |
||
| 901 | public function setUriPublisher($uriPublisher) |
||
| 906 | |||
| 907 | /** |
||
| 908 | * @param $key |
||
| 909 | * @return mixed |
||
| 910 | */ |
||
| 911 | public function getPublisher($key) |
||
| 926 | |||
| 927 | public function setPublisherReference($key, $reference) |
||
| 933 | |||
| 934 | |||
| 935 | /** |
||
| 936 | * (non-PHPdoc) |
||
| 937 | * @see \Core\Entity\PermissionsAwareInterface::getPermissions() |
||
| 938 | */ |
||
| 939 | public function getPermissions() |
||
| 951 | |||
| 952 | /** |
||
| 953 | * (non-PHPdoc) |
||
| 954 | * @see \Core\Entity\PermissionsAwareInterface::setPermissions() |
||
| 955 | */ |
||
| 956 | public function setPermissions(PermissionsInterface $permissions) |
||
| 961 | |||
| 962 | /** |
||
| 963 | * Gets the Values of a job template |
||
| 964 | * |
||
| 965 | * @return TemplateValues |
||
| 966 | */ |
||
| 967 | public function getTemplateValues() |
||
| 974 | |||
| 975 | /** |
||
| 976 | * @param EntityInterface $templateValues |
||
| 977 | * |
||
| 978 | * @return $this |
||
| 979 | */ |
||
| 980 | public function setTemplateValues(EntityInterface $templateValues = null) |
||
| 988 | |||
| 989 | /** |
||
| 990 | * Sets the list of channels where a job opening should be published |
||
| 991 | * |
||
| 992 | * @param Array |
||
| 993 | * {@inheritdoc} |
||
| 994 | */ |
||
| 995 | public function setPortals(array $portals) |
||
| 1000 | |||
| 1001 | /** |
||
| 1002 | * Gets the list of channels where the job opening should be published |
||
| 1003 | * |
||
| 1004 | * {@inheritdoc} |
||
| 1005 | * @return array |
||
| 1006 | */ |
||
| 1007 | public function getPortals() |
||
| 1011 | |||
| 1012 | /** |
||
| 1013 | * Gets the flag indicating the draft state. |
||
| 1014 | * |
||
| 1015 | * @return bool |
||
| 1016 | */ |
||
| 1017 | public function isDraft() |
||
| 1021 | |||
| 1022 | /** |
||
| 1023 | * Sets the flag indicating the draft state. |
||
| 1024 | * |
||
| 1025 | * @param boolean $flag |
||
| 1026 | * @return DraftableEntityInterface |
||
| 1027 | */ |
||
| 1028 | public function setIsDraft($flag) |
||
| 1033 | |||
| 1034 | /** |
||
| 1035 | * Gets the status and checks it against 'active' |
||
| 1036 | * |
||
| 1037 | * @return bool |
||
| 1038 | */ |
||
| 1039 | public function isActive() |
||
| 1043 | |||
| 1044 | /** |
||
| 1045 | * @return Job |
||
| 1046 | */ |
||
| 1047 | public function makeSnapshot() |
||
| 1052 | |||
| 1053 | /** |
||
| 1054 | * @return array|mixed |
||
| 1055 | */ |
||
| 1056 | public function getSnapshotGenerator() |
||
| 1065 | |||
| 1066 | /** |
||
| 1067 | * @param \Jobs\Entity\Classifications $classifications |
||
| 1068 | * |
||
| 1069 | * @return self |
||
| 1070 | */ |
||
| 1071 | public function setClassifications($classifications) |
||
| 1077 | |||
| 1078 | /** |
||
| 1079 | * @return \Jobs\Entity\Classifications |
||
| 1080 | */ |
||
| 1081 | public function getClassifications() |
||
| 1089 | |||
| 1090 | /** |
||
| 1091 | * Mark this job as deleted. |
||
| 1092 | * |
||
| 1093 | * @internal |
||
| 1094 | * This is meant as temporary solution, until |
||
| 1095 | * SoftDelete is implemented. |
||
| 1096 | * |
||
| 1097 | * @return self |
||
| 1098 | * @since 0.29 |
||
| 1099 | */ |
||
| 1100 | public function delete() |
||
| 1106 | |||
| 1107 | public function isDeleted() |
||
| 1111 | |||
| 1112 | |||
| 1113 | } |
||
| 1114 |