Example #1
0
 public static function FindAllByAssociatedId($entityName, $selectorsName, $selectorsValue)
 {
     $allEntities = false;
     self::Connect();
     $allEntities = RedBean_Facade::find($entityName, $selectorsName, $selectorsValue);
     self::Close();
     return $allEntities != false ? $allEntities : false;
 }
Example #2
0
 /**
  * Helper to load all idioms
  */
 public function loadIdioms()
 {
     $idioms = R::find('idiom');
     foreach ($idioms as $item) {
         $idiom = new Idiom();
         $idiom->importBean($item);
         $this->idioms[] = $idiom;
     }
 }
Example #3
0
 /**
  * Checks the database for the existance of the table inside the database, and whether modifications can be made on
  * the table based on the $state variable. if called without the $state variable, this method will check whether the
  * whole resource is disabled.
  * @param  string $package The package name
  * @param  string $state   The state of the action: list, insert, update, remove
  * @return boolean         Whether the system can go ahead with next logic
  */
 public function packageOK($package, $state = null)
 {
     $stateStr = $state ? 'and `' . $state . '` = "true"' : '';
     $packages = R::find('managepackages', ' name = ? and enabled = "true" ' . $stateStr, array($this->cleanup($package)));
     if (count($packages) > 0) {
         foreach ($packages as $package) {
             if ($package->locked === 'true') {
                 R::freeze(true);
             }
         }
         return true;
     }
     return false;
 }
Example #4
0
 /**
  * Load content versions
  * @return array
  */
 public function loadVersions()
 {
     $bean = R::findOne('content', 'alias = ?', array($this->alias));
     if (empty($bean)) {
         return array();
     }
     return R::find('contentversion', '1 AND content_id = ?', array($bean->id));
 }