@param $aObj
@param $bObj

@return int
4622
protected function sortByName($aObj, $bObj)
    {
        $aName = class_basename($aObj);
        $bName = class_basename($bObj);

        return $aName < $bName ? -1 : 1;
    }
153481
public function init(Pluginbase $pObj)
    {
        $this->pObj = $pObj;
        $this->db = $this->pObj->db;
        $this->cObj = $this->pObj->cObj;
        $this->conf = $this->pObj->conf;

        // get sorting values (sortdate, title, what ever...)
        $this->sortBy = GeneralUtility::trimExplode(',', $this->conf['sortByVisitor'], true);
    }
885846
public function getSosaCount(){
        if(!$this->is_setup) return 0;
        return Database::prepare(
            'SELECT COUNT(majs_sosa) FROM `##maj_sosa`' .
            ' WHERE majs_gedcom_id=:tree_id AND majs_user_id=:user_id')
            ->execute(array(
                'tree_id' => $this->tree->getTreeId(), 
                'user_id' => $this->user->getUserId() 
            ))->fetchOne() ?: 0;
    }
63179
protected function _getTitle($oObj)
    {
        $sTitle = $oObj->oxarticles__oxtitle->value;
        if (!strlen($sTitle)) {
            $sTitle = $oObj->oxarticles__oxvarselect->value;
        }

        return $sTitle;
    }
807344
@Override
    public int getChildCount(Object nodeObj) {
        if (debugger == null) {
            return 0;
        }
        VariableNode node = (VariableNode) nodeObj;
        return children(node).length;
    }
1100390
public static function create($obj)
    {
        $nomeTabela        = FuncoesReflections::pegaNomeClasseObjeto($obj);
        $atributosTabela   = FuncoesReflections::pegaAtributosDoObjeto($obj);
        $annotationsTabela = Annotations::getAnnotation($obj);
        $arrFormatado      = [];
        $stringSql = "C" . "REATE TABLE IF NOT EXISTS `" . strtolower($nomeTabela) . "` (";

        for ($i = 0; $i < count($atributosTabela); $i++) {

            $stringSql .= $atributosTabela[$i] . " ";
            for ($j = 0; $j < count($annotationsTabela[$atributosTabela[$i]]); $j++) {

                $arrAtual = explode("=", $annotationsTabela[$atributosTabela[$i]][$j]);
                for ($k = 0; $k < count($arrAtual) - 1; $k++) {
                    $arrFormatado[FuncoesString::substituiOcorrenciasDeUmaString($arrAtual[$k], "@_", "")] = $arrAtual[$k + 1];
                }
            }
            if (array_key_exists('type', $arrFormatado)) {
                $stringSql .= " " . $arrFormatado['type'] . "";

            } else {
                $stringSql .= "";
            }

            if (array_key_exists('size', $arrFormatado)) {
                if ($arrFormatado['size'] != 'none') {
                    $stringSql .= "(" . $arrFormatado['size'] . ") ";
                }

            } else {
                $stringSql .= "";
            }

            /**
             * @todo NOT NULL AQUI
             */

            if (array_key_exists('notNull', $arrFormatado)) {
                if ($arrFormatado['notNull'] === "true") {
                    $stringSql .= " NOT NULL ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            if (array_key_exists('primaryKey', $arrFormatado)) {
                if ($arrFormatado['primaryKey'] === "true") {
                    $stringSql .= " PRIMARY KEY ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            if (array_key_exists('autoIncrement', $arrFormatado)) {
                if ($arrFormatado['autoIncrement'] === "true") {
                    $stringSql .= " AUTO_INCREMENT ";
                } else {
                    $stringSql .= "";
                };
            } else {
                $stringSql .= "";
            }

            if ($i != count($atributosTabela) - 1) {

                $stringSql .= " , ";
            }
        }

        $stringSql .= ") ENGINE = InnoDB;";
        
        echo $stringSql;
        if (JsonReader::read(BASE_DIR . "/phiber_config.json")->phiber->code_sync == 1 ? true : false) {
            $pdo = self::getConnection()->prepare($stringSql);
            if ($pdo->execute()) {
                return true;
            };
        } else {
            return $stringSql;
        }
        
        return false;
    }
1146678
public function Equals($obj)
	{
		if ( ! $obj instanceof Base64BinaryValue )
		{
			return false;
		}

		/**
		 * @var Base64BinaryValue $other
		 */
		$other = $obj;
		return strcmp( $this->BinaryValue, $other->BinaryValue ) == 0;
	}
1330519
protected function validate(Component $vObj)
    {
        $returnCode = 0;

        switch ($vObj->name) {
            case 'VCALENDAR':
                $this->log('iCalendar: '.(string) $vObj->VERSION);
                break;
            case 'VCARD':
                $this->log('vCard: '.(string) $vObj->VERSION);
                break;
        }

        $warnings = $vObj->validate();
        if (!count($warnings)) {
            $this->log('  No warnings!');
        } else {
            $levels = [
                1 => 'REPAIRED',
                2 => 'WARNING',
                3 => 'ERROR',
            ];
            $returnCode = 2;
            foreach ($warnings as $warn) {
                $extra = '';
                if ($warn['node'] instanceof Property) {
                    $extra = ' (property: "'.$warn['node']->name.'")';
                }
                $this->log('  ['.$levels[$warn['level']].'] '.$warn['message'].$extra);
            }
        }

        return $returnCode;
    }
649800
public static function getView( PrintaitorViewObj $printViewObj ) { 
        $data = $printViewObj->dataToView;
        $printer_id = $printViewObj->printerId;
        $templateName = $printViewObj->viewName;
        if (empty($printer_id)) {
            return -1;
        }

        
        $pluginPath = App::path('Lib', 'Printers');


        $driverName = $printViewObj->printer['Printer']['driver'];
        $driverModelName = $printViewObj->printer['Printer']['driver_model'];

        App::build(array('View' => array( $pluginPath[0] . '/DriverView')));

        $viewName = $driverName."Printer/$templateName";
        $View = new View();
        $View->set($data);
   
        $helperName = $driverModelName . $driverName.'Helper'    ;
        App::uses($helperName, 'Printers.Lib/DriverView/Helper');

        if (!class_exists($helperName)) {
            throw new MissingHelperException(array(
                'class' => $helperName,
                'plugin' => substr('Printers', 0, -1)
            ));
        }

        $View->PE = new $helperName($View);
        
        $View->printaitorObj = $printViewObj;
        $view = null;
        try {
            $view = $View->render( $viewName, false );
        } catch (Exception $e) {
            CakeLog::write('debug','No existe la vista de Plugin Printer para '.$e->getMessage() );
        }
        return $view;
        
    }
596027
public static int size(Object obj) {
		if (obj == null) {
			return 0;
		}
		ByteArrayOutputStream buf = new ByteArrayOutputStream(4096);
		try {
			ObjectOutputStream out = new ObjectOutputStream(buf);
			out.writeObject(obj);
			out.flush();
			buf.close();
		} catch (IOException e) {
			return 0;
		}

		return buf.size();
	}
1315740
function count(rawObj) {
    if (typeof rawObj === 'object') {
        if (Array.isArray(rawObj)) {
            return rawObj.length;
        } else {
            return rawObj === null ? 0 : Object.keys(rawObj).length;
        }
    }
    // for number, string, boolean or undefined
    return rawObj === undefined ? 0 : 1;
}
473637
public static function getEntity($associatedObj = null)
    {
        $EntityClass = get_called_class();
        $entityClassRef = new $EntityClass();
        $ActualEntity = ModelEntity::generateClassPath($entityClassRef->getShortName());

        $entityRef = class_exists($ActualEntity) ? new $ActualEntity() : new ModelEntity();
        $entityRef->bindToObject($associatedObj);
        return $entityRef;
    }
866553
public int queryObjJoinCountByCondition(String sql){
		/*		JdbcTemplate jdbcTemplate = (JdbcTemplate) MicroDbHolder
		.getDbSource(dbName);*/
		JdbcTemplate jdbcTemplate = getMicroJdbcTemplate();
		logger.debug(sql);
		Integer total=jdbcTemplate.queryForObject(sql,Integer.class);
		return total;
	}
726743
public function load($obj) {
		parent::load($obj);
		$this->{$this->parentKeyName} = (int)$obj[$this->parentKeyName];
		$this->{$this->leftKeyName} = (int)$obj[$this->leftKeyName];
		$this->{$this->rightKeyName} = (int)$obj[$this->rightKeyName];
		$this->{$this->levelKeyName} = (int)$obj[$this->levelKeyName];
		$this->{$this->groupKeyName} = (int)$obj[$this->groupKeyName];
		return true;
	}
1121493
function objectCount()
    {
        $db = eZDB::instance();

        $languageID = $this->ID;
        if ( $db->databaseName() == 'oracle' )
        {
            $whereSQL = "bitand( language_mask, $languageID ) > 0";
        }
        else
        {
            $whereSQL = "language_mask & $languageID > 0";
        }

        $count = $db->arrayQuery( "SELECT COUNT(*) AS count FROM ezcontentobject WHERE $whereSQL" );
        return $count[0]['count'];
    }
259636
protected function formatObject(
        &$oObj,
        array $aData = [],
        array $aIntegers = [],
        array $aBools = [],
        array $aFloats = []
    ) {

        $aBools[] = 'has_captcha';

        parent::formatObject($oObj, $aData, $aIntegers, $aBools, $aFloats);
    }
914493
private Object newObj(Object obj, XmlParser.Node node) throws NoSuchMethodException,
            ClassNotFoundException, InvocationTargetException, IllegalAccessException
    {
        Class oClass = nodeClass(node);
        String id = node.getAttribute("id");
        int size = 0;
        int argi = node.size();
        for (int i = 0; i < node.size(); i++)
        {
            Object o = node.get(i);
            if (o instanceof String) continue;
            if (!((XmlParser.Node) o).getTag().equals("Arg"))
            {
                argi = i;
                break;
            }
            size++;
        }

        Object[] arg = new Object[size];
        for (int i = 0, j = 0; j < size; i++)
        {
            Object o = node.get(i);
            if (o instanceof String) continue;
            arg[j++] = value(obj, (XmlParser.Node) o);
        }

        if (log.isDebugEnabled()) log.debug("new " + oClass);

        // Lets just try all constructors for now
        Constructor[] constructors = oClass.getConstructors();
        for (int c = 0; constructors != null && c < constructors.length; c++)
        {
            if (constructors[c].getParameterTypes().length != size) continue;

            Object n = null;
            boolean called = false;
            try
            {
                n = constructors[c].newInstance(arg);
                called = true;
            }
            catch (IllegalAccessException e)
            {
                LogSupport.ignore(log, e);
            }
            catch (InstantiationException e)
            {
                LogSupport.ignore(log, e);
            }
            catch (IllegalArgumentException e)
            {
                LogSupport.ignore(log, e);
            }
            if (called)
            {
                if (id != null) _idMap.put(id, n);
                configure(n, node, argi);
                return n;
            }
        }

        throw new IllegalStateException("No Constructor: " + node + " on " + obj);
    }