The page you are looking at now is at this URL: http://pastoid.com/awu
This paste was last updated on April 25, 2009 at 8:48 pm.
<?php class system_classes_VocabularyTest extends PHPUnit_Framework_TestCase { public function testConstruct() { $b = new Bitmask(array('hierarchical', 'unique', 'required', 'free')); $b->hierarchical = true; $v = new Vocabulary('test', 'test vocab', $b); $this->assertType('Vocabulary', $v); $this->assertEquals($v->name, 'test'); $this->assertEquals($v->description, 'test vocab'); $this->assertEquals(1, $v->required); } } ?>
<?php /** * Vocabulary Class * * * @version $Id$ * @copyright 2009 */ class Vocabulary extends QueryRecord { /** * Return the defined database columns for a Post. * @return array Array of columns in the Post table **/ public static function default_fields() { return array( 'id' => 0, 'name' => '', 'description' => '', 'required' => 0, ); } /** * Vocabulary constructor * Creates a Vocabulary instance * * @param string $name The name of the Vocabulary * @param string $description A description of the Vocabulary * @param BitMask $properties Properties of this Vocabulary */ public function __construct($name, $description, BitMask $properties) { // Defaults $this->fields = array_merge( self::default_fields(), $this->fields, $this->newfields ); $paramarray = array( 'name'=> $name, 'description' => $description, 'required' => $properties->value, ); parent::__construct( $paramarray ); $this->exclude_fields( 'id' ); } } ?>
| Referring Domain | Hits |
|---|---|
| Unknown Referer | 158 |
| pastoid.com | 10 |
| search.live.com | 3 |
Tip: Use Pastoid to shorten URLs with this bookmarklet: Pastoid This