PHP Classes

File: Domain/Page.php

Recommend this page to a friend!
  Classes of Igor Dyshlenko   PHP Image Crawler   Domain/Page.php   Download  
File: Domain/Page.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Image Crawler
Crawl Web site pages to find images in the pages
Author: By
Last change:
Date: 2 years ago
Size: 1,758 bytes
 

Contents

Class file image Download
<?php


namespace Domain;


class
Page
{
   
/**
     * Page URL
     *
     * @var string
     */
   
protected $url;

   
/**
     * Children pages
     *
     * @var array
     */
   
protected $children = [];

   
/**
     * <img> tags on page counter.
     *
     * @var int|null
     */
   
protected $imgCount;

   
/**
     * Page processing time, seconds
     *
     * @var float|null $processingTime
     */
   
protected $processingTime;

    public function
__construct(string $url)
    {
       
$this->url = $url;
    }

   
/**
     * @return bool
     */
   
public function isNotProcessed(): bool
   
{
        return
$this->processingTime === null;
    }

    public function
getUrl(): ?string
   
{
        return
$this->url;
    }

   
/**
     * @return array
     */
   
public function getChildren(): array
    {
        return
$this->children;
    }

   
/**
     * @param array $children
     *
     * @return self
     */
   
public function setChildren(array $children): self
   
{
       
$this->children = $children;
        return
$this;
    }

   
/**
     * @return mixed
     */
   
public function getImgCount()
    {
        return
$this->imgCount;
    }

   
/**
     * @param int $imgCount
     *
     * @return self
     */
   
public function setImgCount(int $imgCount): self
   
{
       
$this->imgCount = $imgCount;
        return
$this;
    }

   
/**
     * @return float|null
     */
   
public function getProcessingTime(): ?float
   
{
        return
$this->processingTime;
    }

   
/**
     * @param float $processingTime
     *
     * @return self
     */
   
public function setProcessingTime(float $processingTime): self
   
{
       
$this->processingTime = $processingTime;
        return
$this;
    }
}