Public Member Functions | |
rules () | |
getFieldNames () | |
hasErrors () | |
assignError () | |
getRowsCount () | |
getPathToFile () | |
isExist () | |
getFromCsvRow ($model, $csv_row) | |
getCsvFile () | |
getProfileFieldNames () | |
getUserFieldNames () | |
getUserFromCsvRow ($csv_row) | |
getProfileFromCsvRow ($csv_row) |
Static Public Member Functions | |
static | getPathToFiles () |
static | overrideExisted (&$user, &$profile) |
Public Attributes | |
$file | |
$hashname | |
$valid = false |
Protected Attributes | |
$fieldNames | |
$rowsCount | |
$hasErrors = false | |
$csv_file = null |
Definition at line 20 of file ImportFile.php.
ImportFile::assignError | ( | ) |
Set there is an error in the file
Definition at line 81 of file ImportFile.php.
References hasErrors().
ImportFile::getCsvFile | ( | ) |
Returns the object of csv file
Definition at line 140 of file ImportFile.php.
References getPathToFile(), and isExist().
ImportFile::getFieldNames | ( | ) |
Returns the array of the column names
Definition at line 63 of file ImportFile.php.
References getPathToFile().
Referenced by getProfileFieldNames(), and getUserFieldNames().
ImportFile::getFromCsvRow | ( | $model, | |
$csv_row | |||
) |
Returns the model of necessary class created with values from the passed row
object | $model | active record model instance |
array | $csv_row | an array with form fieldName=>values |
Definition at line 127 of file ImportFile.php.
Referenced by getProfileFromCsvRow(), and getUserFromCsvRow().
ImportFile::getPathToFile | ( | ) |
Returns the path to the uploaded file
Definition at line 110 of file ImportFile.php.
Referenced by getCsvFile(), getFieldNames(), getRowsCount(), and isExist().
|
static |
Returns the path to directory with uploaded files
Definition at line 103 of file ImportFile.php.
ImportFile::getProfileFieldNames | ( | ) |
Returns an array comprising names of profiles fields
Definition at line 185 of file ImportFile.php.
References getFieldNames().
ImportFile::getProfileFromCsvRow | ( | $csv_row | ) |
Returns the model of profile
array | $csv_row | an array with form fieldName=>values |
Definition at line 214 of file ImportFile.php.
References getFromCsvRow().
ImportFile::getRowsCount | ( | ) |
Returns the number of rows in the file
Definition at line 88 of file ImportFile.php.
References getPathToFile(), and isExist().
ImportFile::getUserFieldNames | ( | ) |
Returns an array comprising names of users fields
Definition at line 195 of file ImportFile.php.
References getFieldNames().
ImportFile::getUserFromCsvRow | ( | $csv_row | ) |
Returns the model of user
array | $csv_row | an array with form fieldName=>values |
Definition at line 206 of file ImportFile.php.
References getFromCsvRow().
ImportFile::hasErrors | ( | ) |
Returns the flag if there is validation errors
Definition at line 75 of file ImportFile.php.
Referenced by assignError().
ImportFile::isExist | ( | ) |
Returns the flag if uploaded file exists
Definition at line 117 of file ImportFile.php.
References getPathToFile().
Referenced by getCsvFile(), and getRowsCount().
|
static |
Method looking for the same records in database and uses them if them are existed
object | $user | a user model instance |
object | $profile | a profile model instance |
Definition at line 155 of file ImportFile.php.
References Profile\model(), and User\model().
ImportFile::rules | ( | ) |
Returns the array of rules
Definition at line 53 of file ImportFile.php.