protected function createStorageReflection() { $reflection = parent::createStorageReflection(); $reflection->addMapping('id', 'dept_no'); $reflection->addMapping('name', 'dept_name'); return $reflection; }
public function getManyHasManyParameters(PropertyMetadata $sourceProperty, IMapper $targetMapper) { if ($targetMapper instanceof DepartmentsMapper) { return ['dept_emp', ['emp_no', 'dept_no']]; } return parent::getManyHasManyParameters($sourceProperty, ${$targetMapper}); }
public function getTableName() : string { if (!$this->tableName) { $namespace = explode('\\', $this->getReflection()->getNamespaceName()); array_shift($namespace); $this->tableName = Nextras\Orm\StorageReflection\StringHelper::underscore(implode($namespace)); } return $this->tableName ?: parent::getTableName(); }
protected function createStorageReflection() { $reflection = parent::createStorageReflection(); $reflection->addMapping('employee', 'emp_no'); return $reflection; }
protected function createStorageReflection() { $reflection = parent::createStorageReflection(); $reflection->addMapping('text', 'tweet_text'); return $reflection; }