Beispiel #1
0
 /**
  * Fetch the eZPaEx objects that have updatechildren flag set to 1
  *
  * @param bool $asObject
  * @return array of contentobject_id's corresponding to users that have to be notified
  */
 static function fetchUpdateChildrenPendingList($asObject = true)
 {
     $resultArray = array();
     $conds = array('updatechildren' => 1);
     $pendingList = eZPersistentObject::fetchObjectList(eZPaEx::definition(), null, $conds, null, null, $asObject);
     if (is_array($pendingList) && count($pendingList)) {
         foreach ($pendingList as $pendingItem) {
             $resultArray[$pendingItem->attribute('contentobject_id')] = $pendingItem;
         }
     }
     return $resultArray;
 }
}
$script->setUseDebugOutput($debugOutput);
$script->setAllowedDebugLevels($allowedDebugLevels);
$script->setUseDebugAccumulators($useDebugAccumulators);
$script->setUseDebugTimingPoints($useDebugTimingpoints);
$script->setUseIncludeFiles($useIncludeFiles);
$script->setDebugMessage("\n\n" . str_repeat('#', 36) . $cli->style('emphasize') . " DEBUG " . $cli->style('emphasize-end') . str_repeat('#', 36) . "\n");
$script->initialize();
if (!$script->isInitialized()) {
    $cli->error('Error initializing script: ' . $script->initializationError() . '.');
    $script->shutdown();
    exit;
}
$cli->output("eZPaEx: Set password last updated to current time in all existing users");
$db = eZDB::instance();
$db->setIsSQLOutputEnabled($showSQL);
$db->begin();
$def = eZPaEx::definition();
$table = $def['name'];
$current_time = time();
$query = "UPDATE {$table} SET password_last_updated = {$current_time}";
$db->query($query);
$db->commit();
// The transaction check
$transactionCounterCheck = eZDB::checkTransactionCounter();
if (isset($transactionCounterCheck['error'])) {
    $cli->error($transactionCounterCheck['error']);
}
$cli->output("eZPaEx: Done.");
$script->shutdown();
exit;