예제 #1
0
 /**
  * Constructor.
  * 
  * @param \WordPress\Model\DefinitionInterface $definition
  * @param \WordPress\Model\DefinitionInterface $related_definition
  */
 public function __construct(DefinitionInterface $definition, DefinitionInterface $related_definition)
 {
     $this->definition = $definition;
     $this->key = $this->definition->getPrimaryKey();
     $this->relatedDefinition = $related_definition;
     $this->foreignKey = $this->definition->getName() . '_' . $this->key;
 }
예제 #2
0
 /**
  * Returns the model's primary key.
  * 
  * Default = "id"
  * 
  * @return string
  */
 public function getPrimaryKey()
 {
     return $this->definition->getPrimaryKey();
 }