Commit current progress.
This commit is contained in:
@@ -107,6 +107,9 @@ class Fighter {
|
||||
* Checks is the fighters has stats to pull before proceeding.
|
||||
*/
|
||||
public function checkValidFighter(): bool {
|
||||
if (!$this->crawler) {
|
||||
return FALSE;
|
||||
}
|
||||
$athlete_stats = $this->crawler->filter('h2.stats-records__title')->count();
|
||||
if ($athlete_stats == 0) {
|
||||
return FALSE;
|
||||
|
||||
@@ -163,6 +163,9 @@ class FightImporter {
|
||||
*/
|
||||
public static function createFightsByEvent($event, $context): void {
|
||||
try {
|
||||
/* \Drupal::messenger()->addStatus(print_r($event->field_event_url->uri)); */
|
||||
/* \Drupal::messenger()->addStatus(print_r($event->label())); */
|
||||
/* exit(); */
|
||||
$event_page_html = \Drupal::httpClient()
|
||||
->get(self::EVENT_BASE . $event->field_event_url->uri)
|
||||
->getBody()->getContents();
|
||||
|
||||
@@ -98,9 +98,9 @@ class FighterImporter {
|
||||
else {
|
||||
$fighters_by_div = self::getListOfCurrentFighters();
|
||||
// Process each fighter into system.
|
||||
/* foreach ($fighters_by_div as $division => $fighters) { */
|
||||
/* $this->processDivision($division, $fighters); */
|
||||
/* } */
|
||||
foreach ($fighters_by_div as $division => $fighters) {
|
||||
$this->processDivision($division, $fighters);
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ class FighterImporter {
|
||||
* @param mixed $div
|
||||
* @param mixed $fighters
|
||||
*/
|
||||
public static function processDivision($div, $fighters, &$context): void {
|
||||
public static function processDivision($div, $fighters): void {
|
||||
\Drupal::logger('ufc')->notice("Starting to update $div");
|
||||
|
||||
foreach ($fighters as $fighter_data) {
|
||||
|
||||
Reference in New Issue
Block a user