PHP code example of filmtools / films

1. Go to this page and download the library: Download filmtools/films library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

filmtools / films example snippets



use FilmTools\Films\Film;

$film = new Film;
$film->setManufacturer( "Ilford" );
$film->setName( "HP5+" );
$film->setAsa( 400 );

// Outputs: Ilford HP5+ 400
echo $film;

$film->setName("");
$film->setManufacturer("Kentmere");

// Outputs: Kentmere 400
echo $film;



use FilmTools\Films\FilmInterface;

/**
 * @return string|null
 */
public function getName();


/**
 * @return string|null
 */
public function getManufacturer();


/**
 * @return int|null
 */
public function getAsa();


use FilmTools\Films\FilmProviderInterface;

/**
 * @return FilmInterface|null
 */
public function getFilm();


use FilmTools\Films\FilmAwareInterface;

/**
 * @param FilmInterface|FilmProviderInterface $film
 */
public function setFilm( $film );

 
use FilmTools\Films\FilmProviderInterface;
use FilmTools\Films\FilmProviderTrait;

class MyClass implements FilmProviderInterface {
    use FilmProviderTrait;
}

 
use FilmTools\Films\FilmAwareInterface;
use FilmTools\Films\FilmAwareTrait;

class MyClass implements FilmAwareInterface {
    use FilmAwareTrait;
}