예제 #1
0
 protected function createStorageReflection()
 {
     $reflection = parent::createStorageReflection();
     $reflection->addMapping('id', 'dept_no');
     $reflection->addMapping('name', 'dept_name');
     return $reflection;
 }
예제 #2
0
 public function getManyHasManyParameters(PropertyMetadata $sourceProperty, IMapper $targetMapper)
 {
     if ($targetMapper instanceof DepartmentsMapper) {
         return ['dept_emp', ['emp_no', 'dept_no']];
     }
     return parent::getManyHasManyParameters($sourceProperty, ${$targetMapper});
 }
예제 #3
0
파일: Mapper.php 프로젝트: ytnuk/orm
 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();
 }
예제 #4
0
 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;
 }