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 |
||
| 39 | class Job extends BaseEntity implements JobInterface, |
||
|
|
|||
| 40 | DraftableEntityInterface, |
||
| 41 | SnapshotGeneratorProviderInterface |
||
| 42 | |||
| 43 | { |
||
| 44 | use AttachableEntityTrait, MetaDataProviderTrait, ClonePropertiesTrait; |
||
| 45 | |||
| 46 | |||
| 47 | private $cloneProperties = [ |
||
| 48 | 'classifications', 'atsMode', |
||
| 49 | ]; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * unique ID of a job posting used by applications to reference |
||
| 53 | * a job |
||
| 54 | * |
||
| 55 | * @var String |
||
| 56 | * @ODM\Field(type="string") @ODM\Index |
||
| 57 | **/ |
||
| 58 | protected $applyId; |
||
| 59 | |||
| 60 | /** |
||
| 61 | * title of a job posting |
||
| 62 | * |
||
| 63 | * @var String |
||
| 64 | * @ODM\Field(type="string") |
||
| 65 | */ |
||
| 66 | protected $title; |
||
| 67 | |||
| 68 | |||
| 69 | /** |
||
| 70 | * name of the publishing company |
||
| 71 | * |
||
| 72 | * @var String |
||
| 73 | * @ODM\Field(type="string") |
||
| 74 | */ |
||
| 75 | protected $company; |
||
| 76 | |||
| 77 | /** |
||
| 78 | * publishing company |
||
| 79 | * |
||
| 80 | * @var OrganizationInterface |
||
| 81 | * @ODM\ReferenceOne (targetDocument="\Organizations\Entity\Organization", simple=true, inversedBy="jobs") |
||
| 82 | * @ODM\Index |
||
| 83 | */ |
||
| 84 | protected $organization; |
||
| 85 | |||
| 86 | |||
| 87 | /** |
||
| 88 | * Email Address, which is used to send notifications about e.g. new applications. |
||
| 89 | * |
||
| 90 | * @var String |
||
| 91 | * @ODM\Field(type="string") |
||
| 92 | **/ |
||
| 93 | protected $contactEmail; |
||
| 94 | |||
| 95 | /** |
||
| 96 | * the owner of a Job Posting |
||
| 97 | * |
||
| 98 | * @var UserInterface $user |
||
| 99 | * @ODM\ReferenceOne(targetDocument="\Auth\Entity\User", simple=true) |
||
| 100 | * @ODM\Index |
||
| 101 | */ |
||
| 102 | protected $user; |
||
| 103 | |||
| 104 | /** |
||
| 105 | * all applications of a certain jobad |
||
| 106 | * |
||
| 107 | * @var Collection |
||
| 108 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", simple=true, mappedBy="job", |
||
| 109 | * repositoryMethod="loadApplicationsForJob") |
||
| 110 | */ |
||
| 111 | protected $applications; |
||
| 112 | |||
| 113 | /** |
||
| 114 | * new applications |
||
| 115 | * |
||
| 116 | * @ODM\ReferenceMany(targetDocument="Applications\Entity\Application", |
||
| 117 | * repositoryMethod="loadUnreadApplicationsForJob", mappedBy="job") |
||
| 118 | * @var Int |
||
| 119 | */ |
||
| 120 | protected $unreadApplications; |
||
| 121 | |||
| 122 | /** |
||
| 123 | * language of the job posting. Languages are ISO 639-1 coded |
||
| 124 | * |
||
| 125 | * @var String |
||
| 126 | * @ODM\Field(type="string") |
||
| 127 | */ |
||
| 128 | protected $language; |
||
| 129 | |||
| 130 | /** |
||
| 131 | * location of the job posting. This is a plain text, which describes the location in |
||
| 132 | * search e.g. results. |
||
| 133 | * |
||
| 134 | * @var String |
||
| 135 | * @ODM\Field(type="string") |
||
| 136 | */ |
||
| 137 | protected $location; |
||
| 138 | |||
| 139 | /** |
||
| 140 | * locations of the job posting. This collection contains structured coordinates, |
||
| 141 | * postal codes, city, region, and country names |
||
| 142 | * |
||
| 143 | * @var Collection |
||
| 144 | * @ODM\EmbedMany(targetDocument="Location") |
||
| 145 | */ |
||
| 146 | protected $locations; |
||
| 147 | |||
| 148 | /** |
||
| 149 | * Link which points to the job posting |
||
| 150 | * |
||
| 151 | * @var String |
||
| 152 | * @ODM\Field(type="string") |
||
| 153 | **/ |
||
| 154 | protected $link; |
||
| 155 | |||
| 156 | /** |
||
| 157 | * publishing date of a job posting |
||
| 158 | * |
||
| 159 | * @var String |
||
| 160 | * @ODM\Field(type="tz_date") |
||
| 161 | */ |
||
| 162 | protected $datePublishStart; |
||
| 163 | |||
| 164 | /** |
||
| 165 | * end date of a job posting |
||
| 166 | * |
||
| 167 | * @var String |
||
| 168 | * @ODM\Field(type="tz_date") |
||
| 169 | */ |
||
| 170 | protected $datePublishEnd; |
||
| 171 | |||
| 172 | /** |
||
| 173 | * Status of the job posting |
||
| 174 | * |
||
| 175 | * @var Status |
||
| 176 | * @ODM\EmbedOne(targetDocument="Status") |
||
| 177 | * @ODM\Index |
||
| 178 | */ |
||
| 179 | protected $status; |
||
| 180 | |||
| 181 | /** |
||
| 182 | * History on an job posting |
||
| 183 | * |
||
| 184 | * @var Collection |
||
| 185 | * @ODM\EmbedMany(targetDocument="History") |
||
| 186 | */ |
||
| 187 | protected $history; |
||
| 188 | |||
| 189 | /** |
||
| 190 | * Flag, privacy policy is accepted or not. |
||
| 191 | * |
||
| 192 | * @var bool |
||
| 193 | * @ODM\Boolean |
||
| 194 | */ |
||
| 195 | protected $termsAccepted; |
||
| 196 | |||
| 197 | /** |
||
| 198 | * Reference of a job opening, on which an applicant can refer to. |
||
| 199 | * |
||
| 200 | * @var String |
||
| 201 | * @ODM\Field(type="string") |
||
| 202 | */ |
||
| 203 | protected $reference; |
||
| 204 | |||
| 205 | /** |
||
| 206 | * Unified Resource Locator to the company-Logo |
||
| 207 | * |
||
| 208 | * @var String |
||
| 209 | * @ODM\Field(type="string") |
||
| 210 | */ |
||
| 211 | protected $logoRef; |
||
| 212 | |||
| 213 | /** |
||
| 214 | * Template-Name |
||
| 215 | * |
||
| 216 | * @var String |
||
| 217 | * @ODM\Field(type="string") |
||
| 218 | */ |
||
| 219 | protected $template; |
||
| 220 | |||
| 221 | /** |
||
| 222 | * Application link. |
||
| 223 | * |
||
| 224 | * @var String |
||
| 225 | * @ODM\Field(type="string") |
||
| 226 | */ |
||
| 227 | protected $uriApply; |
||
| 228 | |||
| 229 | /** |
||
| 230 | * Unified Resource Locator the Yawik, which handled this job first - so |
||
| 231 | * does know who is the one who has commited this job. |
||
| 232 | * |
||
| 233 | * @var String |
||
| 234 | * @ODM\Field(type="string") |
||
| 235 | */ |
||
| 236 | protected $uriPublisher; |
||
| 237 | |||
| 238 | /** |
||
| 239 | * @var |
||
| 240 | * @ODM\EmbedMany(targetDocument="Publisher") |
||
| 241 | */ |
||
| 242 | protected $publisher; |
||
| 243 | |||
| 244 | /** |
||
| 245 | * The ATS mode entity. |
||
| 246 | * |
||
| 247 | * @var AtsMode |
||
| 248 | * @ODM\EmbedOne(targetDocument="AtsMode") |
||
| 249 | */ |
||
| 250 | protected $atsMode; |
||
| 251 | |||
| 252 | /** |
||
| 253 | * this must be enabled to use applications forms etc. for this job or |
||
| 254 | * to see number of applications in the list of applications |
||
| 255 | * |
||
| 256 | * @var Boolean |
||
| 257 | * |
||
| 258 | * @ODM\Boolean |
||
| 259 | */ |
||
| 260 | protected $atsEnabled; |
||
| 261 | |||
| 262 | /** |
||
| 263 | * Permissions |
||
| 264 | * |
||
| 265 | * @var PermissionsInterface |
||
| 266 | * @ODM\EmbedOne(targetDocument="\Core\Entity\Permissions") |
||
| 267 | */ |
||
| 268 | protected $permissions; |
||
| 269 | |||
| 270 | /** |
||
| 271 | * The actual name of the organization. |
||
| 272 | * |
||
| 273 | * @var TemplateValues |
||
| 274 | * @ODM\EmbedOne(targetDocument="\Jobs\Entity\TemplateValues") |
||
| 275 | */ |
||
| 276 | protected $templateValues; |
||
| 277 | |||
| 278 | |||
| 279 | /** |
||
| 280 | * Can contain various Portals |
||
| 281 | * |
||
| 282 | * @var array |
||
| 283 | * @ODM\Collection*/ |
||
| 284 | protected $portals = array(); |
||
| 285 | |||
| 286 | /** |
||
| 287 | * Flag indicating draft state of this job. |
||
| 288 | * |
||
| 289 | * @var bool |
||
| 290 | * @ODM\Boolean |
||
| 291 | */ |
||
| 292 | protected $isDraft = false; |
||
| 293 | |||
| 294 | /** |
||
| 295 | * Classifications |
||
| 296 | * |
||
| 297 | * @ODM\EmbedOne(targetDocument="\Jobs\Entity\Classifications") |
||
| 298 | * @var Classifications |
||
| 299 | * @since 0.29 |
||
| 300 | */ |
||
| 301 | protected $classifications; |
||
| 302 | |||
| 303 | /** |
||
| 304 | * Delete flag. |
||
| 305 | * |
||
| 306 | * @internal |
||
| 307 | * This is meant as a temporary flag, until |
||
| 308 | * SoftDelete is implemented. |
||
| 309 | * |
||
| 310 | * @ODM\Field(type="boolean") |
||
| 311 | * @var bool |
||
| 312 | * @since 0.29 |
||
| 313 | */ |
||
| 314 | protected $isDeleted = false; |
||
| 315 | |||
| 316 | /** |
||
| 317 | * @return string |
||
| 318 | */ |
||
| 319 | public function getResourceId() |
||
| 323 | |||
| 324 | /** |
||
| 325 | * @see \Jobs\Entity\JobInterface::setApplyId() |
||
| 326 | * @param String $applyId |
||
| 327 | * @return \Jobs\Entity\JobInterface |
||
| 328 | */ |
||
| 329 | public function setApplyId($applyId) |
||
| 334 | /** |
||
| 335 | * @see \Jobs\Entity\JobInterface::getApplyId() |
||
| 336 | * @return String |
||
| 337 | */ |
||
| 338 | public function getApplyId() |
||
| 346 | |||
| 347 | /** |
||
| 348 | * Gets the title of a job posting |
||
| 349 | * |
||
| 350 | * @return string |
||
| 351 | */ |
||
| 352 | public function getTitle() |
||
| 356 | |||
| 357 | /** |
||
| 358 | * Sets the title of a job posting |
||
| 359 | * |
||
| 360 | * @see \Jobs\Entity\JobInterface::setTitle() |
||
| 361 | * @param String $title |
||
| 362 | * @return \Jobs\Entity\JobInterface |
||
| 363 | */ |
||
| 364 | public function setTitle($title) |
||
| 369 | |||
| 370 | /** |
||
| 371 | * Gets the name oof the company. If there is an organization assigned to the |
||
| 372 | * job posting. Take the name of the organization. |
||
| 373 | * |
||
| 374 | * (non-PHPdoc) |
||
| 375 | * @see \Jobs\Entity\JobInterface::getCompany() |
||
| 376 | */ |
||
| 377 | public function getCompany() |
||
| 384 | |||
| 385 | /** |
||
| 386 | * (non-PHPdoc) |
||
| 387 | * @see \Jobs\Entity\JobInterface::setCompany() |
||
| 388 | */ |
||
| 389 | public function setCompany($company) |
||
| 394 | |||
| 395 | /** |
||
| 396 | * (non-PHPdoc) |
||
| 397 | * @see \Jobs\Entity\JobInterface::getOrganization() |
||
| 398 | */ |
||
| 399 | public function getOrganization() |
||
| 403 | |||
| 404 | /** |
||
| 405 | * @inheritdoc |
||
| 406 | */ |
||
| 407 | public function setOrganization(OrganizationInterface $organization = null) |
||
| 419 | |||
| 420 | /** |
||
| 421 | * (non-PHPdoc) |
||
| 422 | * @see \Jobs\Entity\JobInterface::getContactEmail() |
||
| 423 | */ |
||
| 424 | public function getContactEmail() |
||
| 436 | |||
| 437 | /** |
||
| 438 | * (non-PHPdoc) |
||
| 439 | * @see \Jobs\Entity\JobInterface::setContactEmail() |
||
| 440 | */ |
||
| 441 | public function setContactEmail($email) |
||
| 446 | |||
| 447 | /** |
||
| 448 | * (non-PHPdoc) |
||
| 449 | * @see \Jobs\Entity\JobInterface::setLanguage() |
||
| 450 | */ |
||
| 451 | public function setLanguage($language) |
||
| 456 | /** |
||
| 457 | * (non-PHPdoc) |
||
| 458 | * @see \Jobs\Entity\JobInterface::getLanguage() |
||
| 459 | */ |
||
| 460 | public function getLanguage() |
||
| 464 | /** |
||
| 465 | * (non-PHPdoc) |
||
| 466 | * @see \Jobs\Entity\JobInterface::setLocation() |
||
| 467 | */ |
||
| 468 | public function setLocation($location) |
||
| 473 | /** |
||
| 474 | * (non-PHPdoc) |
||
| 475 | * @see \Jobs\Entity\JobInterface::getLocation() |
||
| 476 | */ |
||
| 477 | public function getLocation() |
||
| 490 | /** |
||
| 491 | * (non-PHPdoc) |
||
| 492 | * @see \Jobs\Entity\JobInterface::setLocations() |
||
| 493 | */ |
||
| 494 | public function setLocations($locations) |
||
| 499 | /** |
||
| 500 | * (non-PHPdoc) |
||
| 501 | * @see \Jobs\Entity\JobInterface::getLocations() |
||
| 502 | */ |
||
| 503 | public function getLocations() |
||
| 510 | /** |
||
| 511 | * (non-PHPdoc) |
||
| 512 | * @see \Jobs\Entity\JobInterface::setUser() |
||
| 513 | */ |
||
| 514 | View Code Duplication | public function setUser(UserInterface $user) |
|
| 523 | /** |
||
| 524 | * (non-PHPdoc) |
||
| 525 | * @see \Jobs\Entity\JobInterface::getUser() |
||
| 526 | */ |
||
| 527 | public function getUser() |
||
| 531 | |||
| 532 | public function unsetUser($removePermissions = true) |
||
| 543 | |||
| 544 | /** |
||
| 545 | * (non-PHPdoc) |
||
| 546 | * @see \Jobs\Entity\JobInterface::setApplications() |
||
| 547 | */ |
||
| 548 | public function setApplications(Collection $applications) |
||
| 553 | |||
| 554 | /** |
||
| 555 | * (non-PHPdoc) |
||
| 556 | * @see \Jobs\Entity\JobInterface::getApplications() |
||
| 557 | */ |
||
| 558 | public function getApplications() |
||
| 562 | |||
| 563 | /** |
||
| 564 | * Gets the number of unread applications |
||
| 565 | * @return Collection |
||
| 566 | */ |
||
| 567 | public function getUnreadApplications() |
||
| 571 | /** |
||
| 572 | * (non-PHPdoc) |
||
| 573 | * @see \Jobs\Entity\JobInterface::getLink() |
||
| 574 | */ |
||
| 575 | public function getLink() |
||
| 579 | /** |
||
| 580 | * (non-PHPdoc) |
||
| 581 | * @see \Jobs\Entity\JobInterface::setLink() |
||
| 582 | */ |
||
| 583 | public function setLink($link) |
||
| 588 | /** |
||
| 589 | * (non-PHPdoc) |
||
| 590 | * @see \Jobs\Entity\JobInterface::getDatePublishStart() |
||
| 591 | */ |
||
| 592 | public function getDatePublishStart() |
||
| 596 | /** |
||
| 597 | * (non-PHPdoc) |
||
| 598 | * @param string $datePublishStart |
||
| 599 | * @see \Jobs\Entity\JobInterface::setDatePublishStart() |
||
| 600 | * @return $this |
||
| 601 | */ |
||
| 602 | View Code Duplication | public function setDatePublishStart($datePublishStart = null) |
|
| 613 | |||
| 614 | /** |
||
| 615 | * (non-PHPdoc) |
||
| 616 | * @see \Jobs\Entity\JobInterface::getDatePublishStart() |
||
| 617 | */ |
||
| 618 | public function getDatePublishEnd() |
||
| 622 | /** |
||
| 623 | * (non-PHPdoc) |
||
| 624 | * @param string $datePublishEnd |
||
| 625 | * @see \Jobs\Entity\JobInterface::setDatePublishEnd() |
||
| 626 | * @return $this |
||
| 627 | */ |
||
| 628 | View Code Duplication | public function setDatePublishEnd($datePublishEnd = null) |
|
| 639 | |||
| 640 | /** |
||
| 641 | * Modifies the state of an application. |
||
| 642 | * |
||
| 643 | * Creates a history entry. |
||
| 644 | * |
||
| 645 | * @param StatusInterface|string $status |
||
| 646 | * @param string $message |
||
| 647 | * @return Job |
||
| 648 | */ |
||
| 649 | View Code Duplication | public function changeStatus($status, $message = '[System]') |
|
| 659 | |||
| 660 | /** |
||
| 661 | * (non-PHPdoc) |
||
| 662 | * @see \Jobs\Entity\JobInterface::getStatus() |
||
| 663 | */ |
||
| 664 | public function getStatus() |
||
| 668 | /** |
||
| 669 | * (non-PHPdoc) |
||
| 670 | * @see \Jobs\Entity\JobInterface::setStatus() |
||
| 671 | */ |
||
| 672 | public function setStatus($status) |
||
| 679 | |||
| 680 | /** |
||
| 681 | * {@inheritDoc} |
||
| 682 | * @see JobInterface::setHistory() |
||
| 683 | * @return Job |
||
| 684 | */ |
||
| 685 | public function setHistory(Collection $history) |
||
| 690 | |||
| 691 | /** |
||
| 692 | * {@inheritDoc} |
||
| 693 | * @see JobInterface::getHistory() |
||
| 694 | */ |
||
| 695 | public function getHistory() |
||
| 702 | |||
| 703 | /** |
||
| 704 | * {@inheritDoc} |
||
| 705 | * @see JobInterface::setTermsAccepted() |
||
| 706 | * @return self |
||
| 707 | */ |
||
| 708 | public function setTermsAccepted($termsAccepted) |
||
| 713 | |||
| 714 | /** |
||
| 715 | * {qinheritDoc} |
||
| 716 | * @see JobInterface::getTermsAccepted() |
||
| 717 | */ |
||
| 718 | public function getTermsAccepted() |
||
| 722 | |||
| 723 | /** |
||
| 724 | * (non-PHPdoc) |
||
| 725 | * @see JobInterface::getReference() |
||
| 726 | */ |
||
| 727 | public function getReference() |
||
| 731 | /** |
||
| 732 | * (non-PHPdoc) |
||
| 733 | * @see JobInterface::setReference() |
||
| 734 | */ |
||
| 735 | public function setReference($reference) |
||
| 740 | |||
| 741 | public function setAtsMode(AtsMode $mode) |
||
| 747 | |||
| 748 | public function getAtsMode() |
||
| 756 | |||
| 757 | |||
| 758 | /** |
||
| 759 | * checks, weather a job is enabled for getting applications |
||
| 760 | * @return boolean |
||
| 761 | */ |
||
| 762 | public function getAtsEnabled() |
||
| 766 | /** |
||
| 767 | * enables a job add to receive applications |
||
| 768 | * |
||
| 769 | * @param boolean $atsEnabled |
||
| 770 | * @return \Jobs\Entity\Job |
||
| 771 | */ |
||
| 772 | public function setAtsEnabled($atsEnabled) |
||
| 777 | /** |
||
| 778 | * returns an uri to the organization logo. |
||
| 779 | * |
||
| 780 | * @return string |
||
| 781 | */ |
||
| 782 | public function getLogoRef() |
||
| 792 | /** |
||
| 793 | * Set the uri to the organisations logo |
||
| 794 | * |
||
| 795 | * @param string $logoRef |
||
| 796 | * @return \Jobs\Entity\Job |
||
| 797 | */ |
||
| 798 | public function setLogoRef($logoRef) |
||
| 803 | |||
| 804 | /** |
||
| 805 | * |
||
| 806 | * |
||
| 807 | * @return string |
||
| 808 | */ |
||
| 809 | public function getTemplate() |
||
| 817 | /** |
||
| 818 | * |
||
| 819 | * |
||
| 820 | * @param string $template name of the Template |
||
| 821 | * @return \Jobs\Entity\Job |
||
| 822 | */ |
||
| 823 | public function setTemplate($template) |
||
| 828 | |||
| 829 | |||
| 830 | |||
| 831 | /** |
||
| 832 | * Gets the uri of an application link |
||
| 833 | * |
||
| 834 | * @return String |
||
| 835 | */ |
||
| 836 | public function getUriApply() |
||
| 840 | |||
| 841 | /** |
||
| 842 | * Sets the uri of an application link |
||
| 843 | * |
||
| 844 | * @param String $uriApply |
||
| 845 | * @return \Jobs\Entity\Job |
||
| 846 | */ |
||
| 847 | public function setUriApply($uriApply) |
||
| 852 | |||
| 853 | /** |
||
| 854 | * Gets the uri of a publisher |
||
| 855 | * |
||
| 856 | * @return String |
||
| 857 | */ |
||
| 858 | public function getUriPublisher() |
||
| 862 | /** |
||
| 863 | * |
||
| 864 | * @param String $uriPublisher |
||
| 865 | * @return \Jobs\Entity\Job |
||
| 866 | */ |
||
| 867 | public function setUriPublisher($uriPublisher) |
||
| 872 | |||
| 873 | /** |
||
| 874 | * @param $key |
||
| 875 | * @return mixed |
||
| 876 | */ |
||
| 877 | public function getPublisher($key) |
||
| 892 | |||
| 893 | public function setPublisherReference($key, $reference) |
||
| 899 | |||
| 900 | |||
| 901 | /** |
||
| 902 | * (non-PHPdoc) |
||
| 903 | * @see \Core\Entity\PermissionsAwareInterface::getPermissions() |
||
| 904 | */ |
||
| 905 | public function getPermissions() |
||
| 917 | |||
| 918 | /** |
||
| 919 | * (non-PHPdoc) |
||
| 920 | * @see \Core\Entity\PermissionsAwareInterface::setPermissions() |
||
| 921 | */ |
||
| 922 | public function setPermissions(PermissionsInterface $permissions) |
||
| 927 | |||
| 928 | /** |
||
| 929 | * Gets the Values of a job template |
||
| 930 | * |
||
| 931 | * @return TemplateValues |
||
| 932 | */ |
||
| 933 | public function getTemplateValues() |
||
| 940 | |||
| 941 | /** |
||
| 942 | * @param EntityInterface $templateValues |
||
| 943 | * |
||
| 944 | * @return $this |
||
| 945 | */ |
||
| 946 | public function setTemplateValues(EntityInterface $templateValues = null) |
||
| 954 | |||
| 955 | /** |
||
| 956 | * Sets the list of channels where a job opening should be published |
||
| 957 | * |
||
| 958 | * @param Array |
||
| 959 | * {@inheritdoc} |
||
| 960 | */ |
||
| 961 | public function setPortals(array $portals) |
||
| 966 | |||
| 967 | /** |
||
| 968 | * Gets the list of channels where the job opening should be published |
||
| 969 | * |
||
| 970 | * {@inheritdoc} |
||
| 971 | * @return Array |
||
| 972 | */ |
||
| 973 | public function getPortals() |
||
| 977 | |||
| 978 | /** |
||
| 979 | * Gets the flag indicating the draft state. |
||
| 980 | * |
||
| 981 | * @return bool |
||
| 982 | */ |
||
| 983 | public function isDraft() |
||
| 987 | |||
| 988 | /** |
||
| 989 | * Sets the flag indicating the draft state. |
||
| 990 | * |
||
| 991 | * @param boolean $flag |
||
| 992 | * @return DraftableEntityInterface |
||
| 993 | */ |
||
| 994 | public function setIsDraft($flag) |
||
| 999 | |||
| 1000 | /** |
||
| 1001 | * Gets the status and checks it against 'active' |
||
| 1002 | * |
||
| 1003 | * @return bool |
||
| 1004 | */ |
||
| 1005 | public function isActive() |
||
| 1009 | |||
| 1010 | /** |
||
| 1011 | * @return Job |
||
| 1012 | */ |
||
| 1013 | public function makeSnapshot() |
||
| 1018 | |||
| 1019 | /** |
||
| 1020 | * @return array|mixed |
||
| 1021 | */ |
||
| 1022 | public function getSnapshotGenerator() |
||
| 1031 | |||
| 1032 | /** |
||
| 1033 | * @param \Jobs\Entity\Classifications $classifications |
||
| 1034 | * |
||
| 1035 | * @return self |
||
| 1036 | */ |
||
| 1037 | public function setClassifications($classifications) |
||
| 1043 | |||
| 1044 | /** |
||
| 1045 | * @return \Jobs\Entity\Classifications |
||
| 1046 | */ |
||
| 1047 | public function getClassifications() |
||
| 1055 | |||
| 1056 | /** |
||
| 1057 | * Mark this job as deleted. |
||
| 1058 | * |
||
| 1059 | * @internal |
||
| 1060 | * This is meant as temporary solution, until |
||
| 1061 | * SoftDelete is implemented. |
||
| 1062 | * |
||
| 1063 | * @return self |
||
| 1064 | * @since 0.29 |
||
| 1065 | */ |
||
| 1066 | public function delete() |
||
| 1072 | |||
| 1073 | |||
| 1074 | } |
||
| 1075 |