2017 © Pedro Peláez
 

library domain-commons

Commons for domain models

image

phpmentors/domain-commons

Commons for domain models

  • Thursday, June 1, 2017
  • by hidenorigoto
  • Repository
  • 4 Watchers
  • 11 Stars
  • 40,758 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 7 Versions
  • 8 % Grown

The README.md

Domain Commons

Commons for domain models, (*1)

Build Status SensioLabsInsight Total Downloads Latest Stable Version Latest Unstable Version, (*2)

Installation

Domain Commons can be installed using Composer., (*3)

$ composer require phpmentors/domain-commons

Features

DateTime basics

Date and Time

  • Date
  • DateTime
  • MonthDay
  • Year
  • YearMonth
  • HourMin
  • AgeRange

Period

  • Duration
  • Period
  • Term

Traversable

  • DailyTrait / DailyIteratableInterface
  • MonthlyTrait / MonthlyIteratableInterface

You can define a domain specific period as follows:, (*4)

namespace MyDomain;

use PHPMentors\DomainCommons\DateTime\Date;
use PHPMentors\DomainCommons\DateTime\Period\DailyIteratableInterface;
use PHPMentors\DomainCommons\DateTime\Period\DailyTrait;

class DailyPeriod extends Period implements DailyIteratableInterface
{
    use DailyTrait;

    public function __construct(Date $start, Date $end)
    {
        parent::__construct($start, $end);
        $this->it = $this->iterate(); // this line enables iterator
    }
}

You can iterate this period by date using standard foreach statement as follows:, (*5)

use PHPMentors\DomainCommons\DateTime\Date;
use MyDomain\DailyPeriod;

$period = new DailyPeriod(new Date('2015-04-12'), new Date('2015-06-30'));

$count = 0;
foreach ($period as $one) {
    echo $one->format('m/d') . PHP_EOL;
}

Utility

  • Clock

Matrix (Typed and Addressed)

  • TypedMatrix
  • AddressedMatrix

Operation

  • ZeroableInterface

String Utility

  • UniqueName

Support

If you find a bug or have a question, or want to request a feature, create an issue or pull request for it on Issues., (*6)

Copyright

Copyright (c) 2015 GOTO Hidenori, 2015 KUBO Atsuhiro, All rights reserved., (*7)

License

The BSD 2-Clause License, (*8)

The Versions

01/06 2017

dev-master

9999999-dev

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

01/06 2017

v1.1.3

1.1.3.0

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

31/05 2017

dev-add-comments-for-datetime-admonths

dev-add-comments-for-datetime-admonths

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

23/03 2016

v1.1.2

1.1.2.0

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

23/03 2016

v1.1.1

1.1.1.0

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

30/09 2015

v1.1.0

1.1.0.0

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori
by KUBO Atsuhiro

datetime ddd domain driven design design modeling

27/05 2015

v1.0.0

1.0.0.0

Commons for domain models

  Sources   Download

BSD-2-Clause

The Requires

 

The Development Requires

by GOTO Hidenori

datetime ddd domain driven design modeling