for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpDraft\Domain\Models;
class PickSearchModel {
/** @var string */
public $draft_id;
public $keywords;
/** @var string Three-char abbreviation */
public $team;
public $position;
/** @var string Sorting by player pick, ASC or DESC */
public $sort;
/** @var array */
public $player_results;
public function __construct($draft_id, $keywords, $team, $position, $sort) {
$this->draft_id = $draft_id;
$this->keywords = $keywords;
$this->team = $team;
$this->position = $position;
$this->sort = $sort;
}
/**
* Used if the strict search returns no results, empty the results (for any reason) and set the count to zero.
*/
public function emptyResultsData() {
unset($this->player_results);
$this->search_count = 0;
search_count
public function hasName() {
return isset($this->keywords) && strlen($this->keywords) > 0;
public function hasTeam() {
return isset($this->team) && strlen($this->team) > 0;
public function hasPosition() {
return isset($this->position) && strlen($this->position) > 0;
public function searchCount() {
return count($player_results);
$player_results