2017 © Pedro Peláez
 

library has-parent

The trait allows set and get parent class of instance.

image

seotils/has-parent

The trait allows set and get parent class of instance.

  • Tuesday, September 6, 2016
  • by seotils
  • Repository
  • 1 Watchers
  • 1 Stars
  • 11 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

HasParent

Description

This trait assigns parent to a class., (*1)

License

HasParent is open-sourced software licensed under the [GPL-3.0] (https://www.gnu.org/licenses/gpl-3.0.en.html)., (*2)

Requirements

Package depends on deferred-exceptions package., (*3)

  1. GitHub:, (*4)

    • [seotils/deferred-exceptions] (https://github.com/seotils/deferred-exceptions)
  2. Composer (packagist.org):, (*5)

    • [seotils/deferred-exceptions] (https://packagist.org/packages/seotils/deferred-exceptions)
  3. PHPClasses:, (*6)

    • [Deferred Exceptions] (http://www.phpclasses.org/package/9854-PHP-Queue-exceptions-and-throws-them-afterwards.html)

Install

composer require seotils/has-parent

Usage

<?php

namespace My;

use Seotils\Traits\HasParent;

/**
 * Parent class
 */
class A {
  public function time(){
    return date('Y-m-d H:i:s');
  }
}

/**
 * Class with HasParent trait
 */
class B {
  use HasParent;
}

// Usage

$a = new A();
$b = new B();

// Assign and use parent class
echo $b->parentClass( $a )->time();

// Or step by step

// Assign parent class
$b->parentClass( $a );

// Use parent class
echo $b->parentClass()->time();

That`s all!, (*7)

The Versions

06/09 2016

dev-master

9999999-dev https://github.com/seotils/has-parent

The trait allows set and get parent class of instance.

  Sources   Download

GPL-3.0

The Requires

 

by deMagog

traits parent class

06/09 2016

0.0.3

0.0.3.0 https://github.com/seotils/has-parent

The trait allows set and get parent class of instance.

  Sources   Download

GPL-3.0

The Requires

 

by deMagog

traits parent class

03/09 2016

0.0.1

0.0.1.0 https://github.com/seotils/has-parent

The trait allows set and get parent class of instance.

  Sources   Download

GPL-3.0

The Requires

 

by deMagog

traits parent class

03/09 2016

0.0.2

0.0.2.0 https://github.com/seotils/has-parent

The trait allows set and get parent class of instance.

  Sources   Download

GPL-3.0

The Requires

 

by deMagog

traits parent class