Skip to content
This repository has been archived by the owner on Nov 28, 2019. It is now read-only.

Commit

Permalink
Introduce Type\MetaRecordIndexInterface
Browse files Browse the repository at this point in the history
Uses by meta filter API to address clearly an object related
meta record #56
  • Loading branch information
dnaber-de committed Feb 17, 2016
1 parent 108536f commit 87d7888
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 0 deletions.
35 changes: 35 additions & 0 deletions inc/Import/Type/MetaRecordIndexInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Import\Type;

/**
* Interface MetaRecordIndexInterface
*
* Describes a »pointer« to a concrete ImportMeta record
*
* @package W2M\Import\Type
*/
interface MetaRecordIndexInterface {

/**
* The type the meta data belongs to
*
* @return string
*/
public function type();

/**
* @return int
*/
public function object_id();

/**
* @return string
*/
public function key();

/**
* @return int
*/
public function index();
}
75 changes: 75 additions & 0 deletions inc/Import/Type/WpMetaRecordIndex.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
<?php # -*- coding: utf-8 -*-

namespace W2M\Import\Type;

class WpMetaRecordIndex implements MetaRecordIndexInterface {

/**
* @var string
*/
private $type = '';

/**
* @var string
*/
private $key = '';

/**
* @var int
*/
private $object_id = 0;

/**
* @var int
*/
private $index = 0;

/**
* @param $key
* @param $object_id
* @param int $index
* @param string $type
*/
public function __construct( $key, $object_id, $index = 0, $type = 'post' ) {

$this->key = (string) $key;
$this->object_id = (int) $object_id;
$this->index = (int) $index;
$this->type = (string) $type;
}

/**
* The type the meta data belongs to
*
* @return string
*/
public function type() {

return $this->type;
}

/**
* @return int
*/
public function object_id() {

return $this->object_id;
}

/**
* @return string
*/
public function key() {

return $this->key;
}

/**
* @return int
*/
public function index() {

return $this->index;
}

}

0 comments on commit 87d7888

Please sign in to comment.