Ejemplo n.º 1
0
    public static function getLoadSql()
    {
        $tableName = ProductOrder::getTableName();
        return '
			SELECT
				`' . $tableName . '`.*
			FROM
				`' . ProductOrder::getDbName() . '`.`' . $tableName . '`
		';
    }
Ejemplo n.º 2
0
    public function loadProductOrder_Collection()
    {
        // Always create the collection
        $collection = new ProductOrder_Collection();
        $this->setProductOrder_Collection($collection);
        // But only populate it if we have key ID
        if ($this->hasKeyId()) {
            $db = ProductOrder::getDb();
            $tableName = ProductOrder::getTableName();
            $sql = '
				SELECT
					`' . $tableName . '`.*
				FROM
					`' . ProductOrder::getDbName() . '`.`' . $tableName . '`
				WHERE
					`' . $tableName . '`.`customer_id` = ' . $db->quote($this->getId()) . '
			';
            // Construct and populate the collection
            $collection->loadBySql($sql);
            foreach ($collection as $element) {
                $element->setCustomer_Object($this);
            }
        }
    }