PHP Classes

File: src/Models/Flags.php

Recommend this page to a friend!
  Classes of Joseluis Laso   PHP Telegram CLI Wrapper   src/Models/Flags.php   Download  
File: src/Models/Flags.php
Role: Class source
Content type: text/plain
Description: Class source
Class: PHP Telegram CLI Wrapper
Send messages and other commands to Telegram users
Author: By
Last change:
Date: 8 years ago
Size: 575 bytes
 

Contents

Class file image Download
<?php

namespace TelegramCliWrapper\Models;


class
Flags
{
    const
BASIC = 256;
    const
UNREAD = 1;

    protected
$data;

   
/**
     * Status constructor.
     */
   
public function __construct($data)
    {
       
$this->data = $data;
    }

    public function
isUnread()
    {
        return (
$this->data & self::UNREAD) > 0;
    }

    public function
isRead()
    {
        return !
$this->isUnread();
    }


    function
__toString()
    {
        return
"[" . $this->data . "]" .
            (
$this->isUnread() ? "Unread" : "Read") .
           
"";
    }


}