lox / pheasant

A lightweight data mapper designed to take advantage of PHP 5.3+
http://getpheasant.com
MIT License
101 stars 21 forks source link

Add Enum Type. Resolves issue #99 #100

Closed andrewk closed 10 years ago

andrewk commented 10 years ago

As discussed in feature request.

lox commented 10 years ago

Might this be better as a parameter to existing string and int types?

<?php

  public function properties()
  {
    return array(
      'title' => new Types\String(255, array('required', 'allowed'=>array('llamas','alpacas')),
      );
  }

That way it's clearer that it's not backed onto an ENUM type.

lox commented 10 years ago

It's more verbose, but probably more Pheasant. Thought @mtibben @harto @rbone ?

harto commented 10 years ago

Good point... we might want to reserve an Enum type for genuine compatibility with MySQL ENUM at some later time.

andrewk commented 10 years ago

I am down with this. Will move Enum code and tests into optional param for String and Int