コード例 #1
0
 /**
  * add a metadata
  *
  * @param array $metadata
  * @return bool
  */
 public function addMetadata($metadata)
 {
     $model = new Metadata($metadata);
     if ($model->validate()) {
         $this->metadata = $metadata;
         return true;
     }
     $this->errors = $model->errors;
     return false;
 }
コード例 #2
0
 /**
  * test whether metadata is created with given values
  */
 public function testCreate()
 {
     $model = new Metadata(['custom_id' => 'Product 0001', 'notification_url' => 'http://my_domain.com/notification']);
     $this->assertTrue($model->validate());
 }