src/FlexiPeeHP/FlexiBeeRW.php
public function takeData($data)
    {
        if ($this->debug === true) {
            $fbRelations = [];
            $fbColumns   = $this->getColumnsInfo();
            foreach ($this->getRelationsInfo() as $relation) {
                if (is_array($relation) && isset($relation['url'])) {
                    $fbRelations[$relation['url']] = $relation['url'];
                }
            }
            if (count($fbColumns)) {
                foreach ($data as $key => $value) {
                    if (!array_key_exists($key, $fbColumns)) {

                        if (!array_key_exists($key, $fbRelations)) {
                            $this->addStatusMessage(sprintf('unknown column %s for evidence %s',
                                    $key, $this->getEvidence()), 'warning');
                        } else {
                            if (!is_array($value)) {
                                $this->addStatusMessage(sprintf('subevidence %s in evidence %s must bee an array',
                                        $key, $this->getEvidence()), 'warning');
                            }
                        }
                    }
                }
            }
        }
        return parent::takeData($data);
    }
public function takeData($data)
    {
        if ($this->debug === true) {
            $fbRelations = [];
            $fbColumns   = $this->getColumnsInfo();
            foreach ($this->getRelationsInfo() as $relation) {
                if (is_array($relation) && isset($relation['url'])) {
                    $fbRelations[$relation['url']] = $relation['url'];
                }
            }
            if (count($fbColumns)) {
                foreach ($data as $key => $value) {
                    if (!array_key_exists($key, $fbColumns)) {

                        if (!array_key_exists($key, $fbRelations)) {
                            $this->addStatusMessage(sprintf('unknown column %s for evidence %s',
                                    $key, $this->getEvidence()), 'warning');
                        } else {
                            if (!is_array($value)) {
                                $this->addStatusMessage(sprintf('subevidence %s in evidence %s must bee an array',
                                        $key, $this->getEvidence()), 'warning');
                            }
                        }
                    }
                }
            }
        }
        return parent::takeData($data);
    }
public function takeData ( $ data ) { if ( $ this -> debug === true ) { $ fbRelations = [ ] ; $ fbColumns = $ this -> getColumnsInfo ( ) ; foreach ( $ this -> getRelationsInfo ( ) as $ relation ) { if ( is_array ( $ relation ) && isset ( $ relation [ 'url' ] ) ) { $ fbRelations [ $ relation [ 'url' ] ] = $ relation [ 'url' ] ; } } if ( count ( $ fbColumns ) ) { foreach ( $ data as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ fbColumns ) ) { if ( ! array_key_exists ( $ key , $ fbRelations ) ) { $ this -> addStatusMessage ( sprintf ( 'unknown column %s for evidence %s' , $ key , $ this -> getEvidence ( ) ) , 'warning' ) ; } else { if ( ! is_array ( $ value ) ) { $ this -> addStatusMessage ( sprintf ( 'subevidence %s in evidence %s must bee an array' , $ key , $ this -> getEvidence ( ) ) , 'warning' ) ; } } } } } } return parent :: takeData ( $ data ) ; }
Control for existing column names in evidence and take data

@param array $data Data to keep

@return int number of records taken
Control for existing column names in evidence and take data