public function columns(array $columnsPropertyMap)
    {
        $this->verifyClassDefined(__METHOD__);
        $this->verifyMapperDefined(__METHOD__);

        $table         = $this->definition->getTable();
        $emptyFunction = function () {
        };

        foreach ($columnsPropertyMap as $column => $property) {
            if (!$table->hasColumn($column)) {
                throw InvalidArgumentException::format(
                    'Invalid column supplied to %s: \'%s\' does not exist on table \'%s\'',
                    __METHOD__, $column, $table->getName()
                );
            }

            if (is_string($property)) {
                $this->readDefinition
                    ->property($property)
                    ->to($column)
                    ->asType($table->findColumn($column)->getType());
            } else {
                $this->readDefinition
                    ->accessor($emptyFunction, $property)
                    ->to($column)
                    ->asType($table->findColumn($column)->getType());
            }
        }
    }
public function columns(array $columnsPropertyMap)
    {
        $this->verifyClassDefined(__METHOD__);
        $this->verifyMapperDefined(__METHOD__);

        $table         = $this->definition->getTable();
        $emptyFunction = function () {
        };

        foreach ($columnsPropertyMap as $column => $property) {
            if (!$table->hasColumn($column)) {
                throw InvalidArgumentException::format(
                    'Invalid column supplied to %s: \'%s\' does not exist on table \'%s\'',
                    __METHOD__, $column, $table->getName()
                );
            }

            if (is_string($property)) {
                $this->readDefinition
                    ->property($property)
                    ->to($column)
                    ->asType($table->findColumn($column)->getType());
            } else {
                $this->readDefinition
                    ->accessor($emptyFunction, $property)
                    ->to($column)
                    ->asType($table->findColumn($column)->getType());
            }
        }
    }
public function columns ( array $ columnsPropertyMap ) { $ this -> verifyClassDefined ( __METHOD__ ) ; $ this -> verifyMapperDefined ( __METHOD__ ) ; $ table = $ this -> definition -> getTable ( ) ; $ emptyFunction = function ( ) { } ; foreach ( $ columnsPropertyMap as $ column => $ property ) { if ( ! $ table -> hasColumn ( $ column ) ) { throw InvalidArgumentException :: format ( 'Invalid column supplied to %s: \'%s\' does not exist on table \'%s\'' , __METHOD__ , $ column , $ table -> getName ( ) ) ; } if ( is_string ( $ property ) ) { $ this -> readDefinition -> property ( $ property ) -> to ( $ column ) -> asType ( $ table -> findColumn ( $ column ) -> getType ( ) ) ; } else { $ this -> readDefinition -> accessor ( $ emptyFunction , $ property ) -> to ( $ column ) -> asType ( $ table -> findColumn ( $ column ) -> getType ( ) ) ; } } }
Defines columns to map to to the supplied properties

@param string[]|callable[] $columnsPropertyMap

@throws InvalidArgumentException
Defines columns to map to to the supplied properties